CVS: Products/PluggableAuthService/plugins - ZODBRoleManager.py:1.6

Tres Seaver <[email protected]>
Newsgroups gmane.comp.web.zope.public-cvs
Message-ID <[email protected]>
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

_______________________________________________
Zope-CVS maillist  -  [email protected]
http://mail.zope.org/mailman/listinfo/zope-cvs

Zope CVS instructions: http://dev.zope.org/CVS
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.