[Zope-CVS] CVS: Products/PluggableAuthService/plugins -
ZODBRoleManager.py:1.6
Tres Seaver
tseaver at palladion.com
Thu Sep 1 13:32:26 EDT 2005
Update of /cvs-repository/Products/PluggableAuthService/plugins
In directory cvs.zope.org:/tmp/cvs-serv23816/plugins
Modified Files:
ZODBRoleManager.py
Log Message:
- Made ZODBRoleManager plugin check grants to the principal's groups,
as well as those made to the principal directly.
=== Products/PluggableAuthService/plugins/ZODBRoleManager.py 1.5 => 1.6 ===
--- Products/PluggableAuthService/plugins/ZODBRoleManager.py:1.5 Wed Jul 6 14:49:05 2005
+++ Products/PluggableAuthService/plugins/ZODBRoleManager.py Thu Sep 1 13:31:56 2005
@@ -88,7 +88,13 @@
""" See IRolesPlugin.
"""
- return tuple( self._principal_roles.get( principal.getId(), () ) )
+ result = list( self._principal_roles.get( principal.getId(), () ) )
+
+ getGroups = getattr( principal, 'getGroups', lambda x: () )
+ for group_id in getGroups():
+ result.extend( self._principal_roles.get( group_id, () ) )
+
+ return tuple( result )
#
# IRoleEnumerationPlugin implementation
More information about the Zope-CVS
mailing list