[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/Security - IPermissionService.py:1.1.2.4 IPrincipalPermissionManageable.py:1.1.2.2 IRolePermissionMap.py:1.1.2.7
Casey Duncan
casey_duncan@yahoo.com
Fri, 15 Feb 2002 16:01:05 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/App/Security
In directory cvs.zope.org:/tmp/cvs-serv29386
Modified Files:
Tag: Zope-3x-branch
IPermissionService.py IPrincipalPermissionManageable.py
IRolePermissionMap.py
Log Message:
Further updated security interfaces to be more in line with reality.
=== Zope3/lib/python/Zope/App/Security/IPermissionService.py 1.1.2.3 => 1.1.2.4 ===
"""
- def getPermission(pid):
+ def getPermission(permission_id):
"""Return an 'IPermission' object for the
given permission id. Return None if there is no permission defined"""
=== Zope3/lib/python/Zope/App/Security/IPrincipalPermissionManageable.py 1.1.2.1 => 1.1.2.2 ===
"""Management interface for mappings between principals and permissions."""
- def grantPermissionToPrincipal(permission, principal):
+ def grantPermissionToPrincipal(permission_id, principal_id):
"""Assert that the permission is allowed for the principal.
-
- permission must be an IPermission
- principal must be an IPrincipal
"""
- def denyPermissionToPrincipal(permission, principal):
+ def denyPermissionToPrincipal(permission_id, principal_id):
"""Assert that the permission is denied to the principal.
-
- permission must be an IPermission
- principal must be an IPrincipal
"""
- def unsetPermissionForPrincipal(permission, principal):
+ def unsetPermissionForPrincipal(permission_id, principal_id):
"""Remove the permission (either denied or allowed) from the
principal.
-
- permission must be an IPermission
- principal must be an IPrincipal
"""
- def getSetting(permission, principal):
+ def getSetting(permission_id, principal_id):
"""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/IRolePermissionMap.py 1.1.2.6 => 1.1.2.7 ===
def getPermissionsForRole(role_id):
- """Return a sequence of permissions for the given role.
+ """Return a sequence of (permission id, setting) tuples for the given
+ role.
If no permissions have been granted to this
role, then the empty list is returned.
"""
def getRolesForPermission(permission_id):
- """Return a sequence of roles for the given permission.
+ """Return a sequence of (role id, setting) tuples for the given
+ permission.
If no roles have been granted this permission, then the empty list is
returned.
@@ -35,7 +37,7 @@
def getSetting(permission_id, role_id):
"""Return the setting for the given permission id and role id
- If there is no setting, return None
+ If there is no setting, Unset is returned
"""
def getPrincipalsAndRoles():