[Zope-Checkins] CVS: Zope2 - Role.py:1.50

chrism@serenade.digicool.com chrism@serenade.digicool.com
Sun, 3 Jun 2001 02:44:34 -0400


Update of /cvs-repository/Zope2/lib/python/AccessControl
In directory serenade:/home/chrism/sandboxes/NewProduct/lib/python/AccessControl

Modified Files:
	Role.py 
Log Message:
Added 'users_with_local_role' method.  This method takes a role string (e.g. 'Owner') as an argument and returns the usernames which have that local role respective to the object which is asked.  The username is returned as a bare string (without a database path).



--- Updated File Role.py in package Zope2 --
--- Role.py	2001/05/23 19:12:38	1.49
+++ Role.py	2001/06/03 06:44:34	1.50
@@ -364,6 +364,13 @@
             info.append((key, value))
         return tuple(info)
 
+    def users_with_local_role(self, role):
+        got = {}
+        for user, roles in self.get_local_roles():
+            if role in roles:
+                got[user] = 1
+        return got.keys()
+
     def get_valid_userids(self):
         item=self
         dict={}