[Zope-dev] ZopeSecurityPolicy & this()

Petr Knapek knapek@knapek.pvt.net
28 Mar 2001 18:16:37 +0200


Hi Zopists,=20
I have now problem with executable content where this() is called.=20=20

My problem:

I have this structure in ZODB
 /
 |_ acl_users (Zope default)
 |_ dalmatin (ISNG Folder) *  ownes user who is in role Manager from /d=
almatin/acl_users
    |_ acl_users (Modified LDAPAdapter)
    |_ index (ISNG Document) ** ownes user who is in role Manager from =
/dalmatin/acl_users

*  ISNG Folder is my python product which is created from Folder
( ISNGFolder(Folder) )=20
** ISNG Document is my python product, it is created from DTML Document
( ISNGDocument(DTMLDocument) )

In index I call this:

<dtml-if "AUTHENTICATED_USER.hasRole('nextra.cz', this())">
...

and when I try to execute index also when I am in role Manager from
/dalmatin/acl_users, an Zope error is raised that I am not autorized to
access object this.=20


 Zope Error

 Zope has encountered an error while publishing this resource.=20

 Unauthorized

 You are not authorized to access this.=20

 Traceback (innermost last):
   File /usr/local/Zope-2.3.0-src/lib/python/ZPublisher/Publish.py, lin=
e 222, in publish_module
   File /usr/local/Zope-2.3.0-src/lib/python/ZPublisher/Publish.py, lin=
e 187, in publish
   File /usr/local/Zope-2.3.0-src/lib/python/ZPublisher/Publish.py, lin=
e 171, in publish
   File /usr/local/Zope-2.3.0-src/lib/python/ZPublisher/mapply.py, line=
 160, in mapply
     (Object: index)
   File /usr/local/Zope-2.3.0-src/lib/python/ZPublisher/Publish.py, lin=
e 112, in call_object
     (Object: index)
   File /usr/local/Zope-2.3.0-src/lib/python/OFS/DTMLDocument.py, line =
189, in __call__
     (Object: index)
   File /usr/local/Zope-2.3.0-src/lib/python/DocumentTemplate/DT_String=
.py, line 538, in __call__
     (Object: index)
   File /usr/local/Zope-2.3.0-src/lib/python/DocumentTemplate/DT_Util.p=
y, line 328, in eval
     (Object: AUTHENTICATED_USER.hasRole('nextra.cz', this()))
     (Info: this)
   File /usr/local/Zope-2.3.0-src/lib/python/OFS/DTMLMethod.py, line 26=
1, in validate
     (Object: index)
   File /usr/local/Zope-2.3.0-src/lib/python/AccessControl/SecurityMana=
ger.py, line 144, in validate
   File /usr/local/Zope-2.3.0-src/lib/python/AccessControl/ZopeSecurity=
Policy.py, line 199, in validate
 Unauthorized: (see above)


Can somebody help me to solve my problem with ZopeSecurityPolicy?

Zope 2.3.0 (compiled from sources) on Debian=20=20
--=20
Petr Kn=E1pek
NEXTRA Czech Republic, s.r.o., Hlinky 114, 603 00 Brno, Czech Republic
e-mail: mailto:petr.knapek@nextra.cz
tel:+420-5-43 554 150
FAX:+420-5-43 554 214

"Perl is worse than Python because people wanted it worse."
Larry Wall, 14 Oct 1998