[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/Security - RoleRegistry.py:1.1.2.5

Jim Fulton jim@zope.com
Fri, 28 Dec 2001 08:39:41 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/App/Security
In directory cvs.zope.org:/tmp/cvs-serv15857

Modified Files:
      Tag: Zope-3x-branch
	RoleRegistry.py 
Log Message:
Added missing method to get all items in registry, as defined by interfaces

=== Zope3/lib/python/Zope/App/Security/RoleRegistry.py 1.1.2.4 => 1.1.2.5 ===
 from Zope.App.Security.Registry import Registry
 from IRole import IRole
+from IRoleService import IRoleService
 
 class Role(RegisteredObject):
     __implements__ = IRole
 
 
 class RoleRegistry(Registry):
+    __implements__ = IRoleService
 
     def __init__(self, prefix=PREFIX):
         Registry.__init__(self, Role)
@@ -55,6 +57,11 @@
         If no named role is registered KeyError is raised.
         """
         return self.getRegisteredObject(id)
+
+    def getRoles(self):
+        """Return all registered role objects.
+        """
+        return self.getRegisteredObjects()
 
     def _clear(self):
         # Standard roles