[Zope] Product Creation and Permission

Casey Duncan cduncan@kaivo.com
Wed, 02 May 2001 13:27:22 -0600


Jason Joy wrote:
> 
> Hey there, I have a question regarding the use of permissions in Classes,
> regarding the creation of user-made Products for Zope.
> 
> The product that I have is made from 2 classes, which for this example I will
> call classes A and B.  From the management screen of Class A after you create
> a instance of it in Zope, it shows a list from a external database of
> instances of B.  B does not get into the Zope Database at all.  A's code has
> been modified in the manage_menu system such that it can add and subtract
> instances of B from the external database.  It does this just fine.
> 
> When selecting a instance of B (let's call it C), from the management menu of
> A, I keep getting asked to enter my password and can never get in, eventually
> getting it to say that I don't have permission to manage it or view it.  I
> tried adding:
> 
>         security = ClassSecurityInfo()
>         security.declareObjectPublic()
>         security.setDefaultAccess('allow')
>         security.__allow_access_to_unprotected_subobjects__ = 1
> 
[snip]

Your last line is close, add the class attribute:

__allow_access_to_unprotected_subobjects__ = 1

to the class definition in A. This tells zope to allow access to
subobjects TTW which is prohibited by default.

hth,
-- 
| Casey Duncan
| Kaivo, Inc.
| cduncan@kaivo.com
`------------------>