[Zope-dev] Objects, Roles and Permissions
Danny William Adair
Danny@Adair.net
Tue, 10 Apr 2001 10:00:38 +1200
Hello warriors,
what's the fastest way to find out whether a specific role has a specific
permission on a specific object? What's the fastest way to find out if it's
acquired?
Even more interesting:
How would I find out whether a specific role has a specific permission on a
specific object, _taking_acquired_rights_into_account_??? In other words
(management screen): "View" permission is not checked for the Anonymous
role, but acquired. Therefore the "Anonymous" role maybe _does_ have the
permission to "View" this object, through acquisition. Would I have to climb
up the ladder manually and check every parent until acquisition has been
"turned off", or is there some function - even if it's only available for an
external method - that already does this work?
I looked through the ZMI pages (and the .py's under
"lib/python/AccessControl") but couldn't find anything useful for this
purpose. Iterating through permission_settings takes too long and I don't
know how to access the specific roles/permissions directly (by name), mainly
because mapping constructions like "p199r0" are not very handy...
Thank you very much in advance for your help (dtml, pyhton, or docs I didn't
see),
Danny