[Zope] [python script] problem with AUTHENTICATED_USER

Andreas Jung lists at andreas-jung.com
Wed Apr 20 10:37:49 EDT 2005



--On Mittwoch, 20. April 2005 16:30 Uhr +0200 BonviciniJ at keops.net wrote:

> I have problem with my python script.
> I want to check if a user has a the "manager" role, and add an option in
> a menu in this case Here is my script:
>
> for el in rep.objectValues('Folder'):
>             if el.id=="Administration" and
> AUTHENTICATED_USER.has_role(self, ["Manager"]):
> #add option to the menu

The recommended way to determine the current user is:

from AccessControl import getSecurityManager()
user = getSecurityManager().getUser()

-aj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope/attachments/20050420/99388951/attachment.bin


More information about the Zope mailing list