[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/Security - PermissionRegistry.py:1.1.2.14

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


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

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

=== Zope3/lib/python/Zope/App/Security/PermissionRegistry.py 1.1.2.13 => 1.1.2.14 ===
 from Zope.App.Security.Registry import Registry
 from IPermission import IPermission
+from IPermissionService import IPermissionService
 
 
 class Permission(RegisteredObject):
@@ -25,6 +26,8 @@
 
 
 class PermissionRegistry(Registry):
+    __implements__ = IPermissionService
+    
     def __init__(self, prefix=PREFIX):
         Registry.__init__(self, Permission)
         self._prefix = prefix
@@ -53,6 +56,11 @@
 
         """
         return self.getRegisteredObject(permission_id)
+
+    def getPermissions(self):
+        """Return all registered permission objects.
+        """
+        return self.getRegisteredObjects()
 
     def _clear(self):
         Registry._clear(self)