[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/Security - RolePermissionManager.py:1.1.2.5
Jim Fulton
jim@zope.com
Thu, 3 Jan 2002 14:05:39 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/App/Security
In directory cvs.zope.org:/tmp/cvs-serv11753
Modified Files:
Tag: Zope-3x-branch
RolePermissionManager.py
Log Message:
Added retract method.
Got rid of redundant doc strings. Methods are documented by
interfaces.
=== Zope3/lib/python/Zope/App/Security/RolePermissionManager.py 1.1.2.4 => 1.1.2.5 ===
__implements__ = IRolePermissionManager
- def grantPermissionToRole( self, permission, role ):
- """Bind the permission to the role.
+ # Implementation methods for interface
+ # Zope.App.Security.IRolePermissionManager
- permission must be an IPermission
- role must be an IRole
- """
+ def grantPermissionToRole( self, permission, role ):
+ '''See interface IRolePermissionMap'''
self.addCell( permission, role )
- def getRolesForPermission( self, permission ):
- """Return the list of roles for the given permission.
+ def retractPermissionFromRole( self, permission, role ):
+ '''See interface IRolePermissionMap'''
+ self.delCell( permission, role )
- permission must be an IPermission. If no roles have been granted this
- permission, then the empty list is returned.
- """
+ def getRolesForPermission( self, permission ):
+ '''See interface IRolePermissionMap'''
return self.getColumnsForRow( permission )
def getPermissionsForRole( self, role ):
- """Return the list of permissions for the given role.
-
- role must be an IRole. If no permissions have been granted to this
- role, then the empty list is returned.
- """
+ '''See interface IRolePermissionMap'''
return self.getRowsForColumn( role )
def setPermissionAcquired(self, permission, flag):
- """Set a flag indicating whether permission settings are acquired.
-
- Permission settings are acquired by default.
- """
+ '''See interface IRolePermissionMap'''
self._nonacquiredperms[permission] = flag
def getPermissionAcquired(self, permission):
- """Return a flag indicating whether permission settings are acquired.
- """
+ '''See interface IRolePermissionMap'''
return self._nonacquiredperms.get(permission, 1)
# Override _clear() so we can add the extra little acquired permission