Commit 3d2ea17d authored by Chris McDonough's avatar Chris McDonough

Added 'users_with_local_role' method. This method takes a role string (e.g....

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).
parent 812809bd
......@@ -84,7 +84,7 @@
##############################################################################
"""Access control support"""
__version__='$Revision: 1.49 $'[11:-2]
__version__='$Revision: 1.50 $'[11:-2]
from Globals import DTMLFile, MessageDialog, Dictionary
......@@ -364,6 +364,13 @@ class RoleManager(ExtensionClass.Base, PermissionMapping.RoleManager):
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={}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment