[Zope-dev] manage_access problems
Dieter Maurer
dieter@handshake.de
Thu, 30 Aug 2001 21:29:41 +0200 (CEST)
Johan Beauce writes:
> I would like find a function like "manage_acces" which can give me the roles
> cheked for a permission.
> Example : I have a folder "myFolder" and I use this function :
> <dtml-let
> folderPermissions="folderEditing.rolesOfPermission('Access contents
> information')">
> <dtml-var folderPermissions>
> </dtml-let>
> the variable folderPermissions return me this list :
> [{'selected': '', 'name': 'Anonymous'}, {'selected': 'SELECTED', 'name':
> 'Manager'}, {'selected': '', 'name': 'Member'}, {'selected': '', 'name':
> 'Owner'}, {'selected': 'SELECTED', 'name': 'Reviewer'}, {'selected': '',
> 'name': 'User'}, {'selected': '', 'name': 'publisher'}]
Python Script:
Arguments: obj, permission
Body:
roles= []
for d in obj.rolesOfPermission(permission):
if d['selected']: roles.append(d['name'])
return roles
Dieter