[Zope] Re: Product Creation and Permission

Casey Duncan cduncan@kaivo.com
Thu, 03 May 2001 13:30:52 -0600


Jason Joy wrote:
> 
> I started working on this the other day and posted some questions regarding
> this, and I apologize ahead of time for the length of this message, but this
> has me absolutely baffled and if anyone can offer some insight into Zope's
> ObjectManger and how it works in regards to this, it would be extremely
> appreciated.
> 
> I am constructing a product that is basically in essence a SQL-Zclass, where
> you can manipulate SQL in a Object Manager.  I have two classes, A and B,
> where B works off of A.
> 
> So, after you create a instance of A in Zope (in a folder or such), it appears
> .. and then you click on it, it brings up a management screen (assuming that
> we're allowable to do such) that runs a SQL command that displays the results
> as "objects" in the instance of A.  These instances displayed in A are related
> to B.  Clicking on one of these new instances of B should bring up a list of
> further related objects contained in B (in the SQL database) and allow you to
> manage objects C, D, E... etc.  The problem that I am getting is A works fine,
> and shows the objects of B contained within.  However, when I click on one of
> these in the management screen, I get a request to login again, and I can
> never enter in a correct authentication despite having full privledges to this
> Zope server, and after three tries, I am dropped to a Unauthorized screen
> saying that Username and Password are not correct.
> 

In the definition of B there unser __ac_permissions__, you have a
permission called 'Management Screens'. You might want to change that to
'View management screens'. Also, this is just loose in the module, it
does no good there AFAIK. Put it inside the class def.

You set permissions on the constructor methods in you __init__.py
RegisterClass call.

The last two lines of your __init__ def of B do nothing. They are local
variables that never see the light of day.
-- 
| Casey Duncan
| Kaivo, Inc.
| cduncan@kaivo.com
`------------------>