[Re: [Zope] Product Creation and Permission]
Jason Joy
kyroraz@usa.net
2 May 2001 13:05:31 MST
> > The product that I have is made from 2 classes, which for this exampl=
e I
will
> > call classes A and B. From the management screen of Class A after yo=
u
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 c=
ode
has
> > been modified in the manage_menu system such that it can add and subt=
ract
> > 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 i=
t. =
I
> > tried adding:
> > =
> > security =3D ClassSecurityInfo()
> > security.declareObjectPublic()
> > security.setDefaultAccess('allow')
> > security.__allow_access_to_unprotected_subobjects__ =3D 1
> > =
> [snip]
> =
> Your last line is close, add the class attribute:
> =
> __allow_access_to_unprotected_subobjects__ =3D 1
> =
> to the class definition in A. This tells zope to allow access to
> subobjects TTW which is prohibited by default.
I assume you mean like this:
class A(
OFS.ObjectManager.ObjectManager,
OFS.PropertyManager.PropertyManager,
Acquisition.Implicit,
Persistent,
AccessControl.Role.RoleManager,
OFS.SimpleItem.Item,
):
__allow_access_to_unprotected_subobjects__ =3D 1
I also, just for paranoia sake, added it before Class A is defined as wel=
l as
Class B. =
This is the result of this attempt:
Zope has encountered an error while publishing this resource. =
Unauthorized
You are not authorized to access this resource.
Username and password are not correct. =
Traceback (innermost last):
File /usr/local/Zope-2.3.0/lib/python/ZPublisher/Publish.py, line 222, =
in
publish_module
File /usr/local/Zope-2.3.0/lib/python/ZPublisher/Publish.py, line 187, =
in
publish
File /usr/local/Zope-2.3.0/lib/python/ZPublisher/Publish.py, line 162, =
in
publish
File /usr/local/Zope-2.3.0/lib/python/ZPublisher/BaseRequest.py, line 4=
60,
in traverse
File /usr/local/Zope-2.3.0/lib/python/ZPublisher/HTTPResponse.py, line =
589,
in unauthorized
Unauthorized: (see above)
Last time I checked, my login worked. :)
Jason
____________________________________________________________________
Get free email and a permanent address at http://www.netaddress.com/?N=3D=
1