[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/Security - AttributePrincipalPermissionManager.py:1.1.2.2 IPrincipalPermissionManager.py:1.1.2.4 IPrincipalPermissionMap.py:1.1.2.3 PrincipalPermissionManager.py:1.1.2.8
Casey Duncan
casey_duncan@yahoo.com
Sat, 9 Feb 2002 16:31:30 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/App/Security
In directory cvs.zope.org:/tmp/cvs-serv28424/lib/python/Zope/App/Security
Modified Files:
Tag: Zope-3x-branch
AttributePrincipalPermissionManager.py
IPrincipalPermissionManager.py IPrincipalPermissionMap.py
PrincipalPermissionManager.py
Log Message:
Added getPrincipalsAndPermissions API to the PrincipalPermissionManager for
use by management views.
=== Zope3/lib/python/Zope/App/Security/AttributePrincipalPermissionManager.py 1.1.2.1 => 1.1.2.2 ===
return []
+ def getPrincipalsAndPermissions( self ):
+ ''' See the interface IPrincipalPermissionManager '''
+ pp = self._getPrincipalPermissions()
+ if pp:
+ return pp.getAllCells()
+ return []
+
# Implementation helpers
def _getPrincipalPermissions(self, create=0):
=== Zope3/lib/python/Zope/App/Security/IPrincipalPermissionManager.py 1.1.2.3 => 1.1.2.4 ===
principal must be an IPrincipal
"""
-
- def getSetting(permission, principal):
- """Get the setting (Allow/Deny/Unset) for a given permission
- and principal.
-
- permission must be an IPermission
- principal must be an IPrincipal
- """
=== Zope3/lib/python/Zope/App/Security/IPrincipalPermissionMap.py 1.1.2.2 => 1.1.2.3 ===
principal must be an IPrincipal. If no permissions have been set for
this principal, then the empty list is returned. """
+
+ def getSetting(permission, principal):
+ """Get the setting (Allow/Deny/Unset) for a given permission
+ and principal.
+
+ permission must be an IPermission
+ principal must be an IPrincipal
+ """
+
+ def getPrincipalsAndPermissions():
+ """Get the principal security assertions here in the form
+ of a list of three tuple containing (permission, principal, setting)"""
=== Zope3/lib/python/Zope/App/Security/PrincipalPermissionManager.py 1.1.2.7 => 1.1.2.8 ===
return self.getCell( permission, principal, default=Unset )
+ def getPrincipalsAndPermissions( self ):
+ ''' See the interface IPrincipalPermissionManager '''
+ return self.getAllCells()
+
+
# Permissions are our rows, and principals are our columns
principalPermissionManager = PrincipalPermissionManager()