[Zope3-checkins] CVS: Zope3/src/zope/app/interfaces/security -
__init__.py:1.11.22.1
Chris McDonough
chrism at plope.com
Wed Jan 14 01:07:18 EST 2004
Update of /cvs-repository/Zope3/src/zope/app/interfaces/security
In directory cvs.zope.org:/tmp/cvs-serv26777/src/zope/app/interfaces/security
Modified Files:
Tag: steveachrismcd-securitypolicy-branch
__init__.py
Log Message:
Move role-related interfaces to securitypolicy product.
=== Zope3/src/zope/app/interfaces/security/__init__.py 1.11 => 1.11.22.1 ===
--- Zope3/src/zope/app/interfaces/security/__init__.py:1.11 Thu Jul 31 23:12:28 2003
+++ Zope3/src/zope/app/interfaces/security/__init__.py Wed Jan 14 01:06:47 2004
@@ -4,6 +4,23 @@
from zope.interface import Interface
from zope.schema.interfaces import IEnumerated, IField
+class IRegisteredObject(Interface):
+
+ def getId():
+ """Get the id of the registered object."""
+
+ def getTitle():
+ """Get the human readable title of the registered object.
+ Must be a string, but it may be empty.
+ """
+
+ def getDescription():
+ """Get the human readable description of the registered object.
+ Must be a string, but it may be empty.
+ """
+
+
+
class IPrincipal(Interface):
"""Provide information about principals.
@@ -155,52 +172,6 @@
The realm argument is the name of the principal registry.
"""
-class IRegisteredObject(Interface):
-
- def getId():
- """Get the id of the registered object."""
-
- def getTitle():
- """Get the human readable title of the registered object.
- Must be a string, but it may be empty.
- """
-
- def getDescription():
- """Get the human readable description of the registered object.
- Must be a string, but it may be empty.
- """
-
-
-class IRole(IRegisteredObject):
- """A role object."""
-
-class IRoleService(Interface):
- """Define roles
-
- 'IRoleService' objects are used to implement role-definition
- services. Because they implement services, they are expected to
- collaborate with services in other contexts. Client code doesn't
- sarch a context and call multiple services. Instead, client code
- will call the most specific service in a place and rely on the
- service to delegate to other services as necessary.
-
- The interface doesn't include methods for data
- management. Services may use external data and not allow
- management in Zope. Simularly, the data to be managed may vary
- with different implementations of a service.
- """
-
- def getRole(rid):
- """Return an 'IRole' object for the given role id."""
-
-
- def getRoles():
- """Return a sequence of the roles (IRole objects)
- defined in the place containing the service."""
-
-
-
-
class IPermission(IRegisteredObject):
"""A permission object."""
@@ -241,162 +212,3 @@
u"""Fields with Permissions as values
"""
-class IPrincipalRoleMap(Interface):
- """Mappings between principals and roles."""
-
- def getPrincipalsForRole(role_id):
- """Get the principals that have been granted a role.
-
- Return the list of (principal id, setting) who have been assigned or
- removed from a role.
-
- If no principals have been assigned this role,
- then the empty list is returned.
- """
-
- def getRolesForPrincipal(principal_id):
- """Get the roles granted to a principal.
-
- Return the list of (role id, setting) assigned or removed from
- this principal.
-
- If no roles have been assigned to
- this principal, then the empty list is returned.
- """
-
- def getSetting(role_id, principal_id):
- """Return the setting for this principal, role combination
- """
-
- def getPrincipalsAndRoles():
- """Get all settings.
-
- Return all the principal/role combinations along with the
- setting for each combination as a sequence of tuples with the
- role id, principal id, and setting, in that order.
- """
-
-
-class IPrincipalRoleManager(IPrincipalRoleMap):
- """Management interface for mappings between principals and roles."""
-
- def assignRoleToPrincipal(role_id, principal_id):
- """Assign the role to the principal."""
-
- def removeRoleFromPrincipal(role_id, principal_id):
- """Remove a role from the principal."""
-
- def unsetRoleForPrincipal(role_id, principal_id):
- """Unset the role for the principal."""
-
-
-class IRolePermissionMap(Interface):
- """Mappings between roles and permissions."""
-
- def getPermissionsForRole(role_id):
- """Get the premissions granted to a 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):
- """Get the roles that have a 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.
- """
-
- def getSetting(permission_id, role_id):
- """Return the setting for the given permission id and role id
-
- If there is no setting, Unset is returned
- """
-
- def getRolesAndPermissions():
- """Return a sequence of (permission_id, role_id, setting) here.
-
- The settings are returned as a sequence of permission, role,
- setting tuples.
-
- If no principal/role assertions have been made here, then the empty
- list is returned.
- """
-
-
-class IRolePermissionManager(IRolePermissionMap):
- """Management interface for mappings between roles and permissions."""
-
- def grantPermissionToRole(permission_id, role_id):
- """Bind the permission to the role.
- """
-
- def denyPermissionToRole(permission_id, role_id):
- """Deny the permission to the role
- """
-
- def unsetPermissionFromRole(permission_id, role_id):
- """Clear the setting of the permission to the role.
- """
-
-
-class IPrincipalPermissionMap(Interface):
- """Mappings between principals and permissions."""
-
- def getPrincipalsForPermission(permission_id):
- """Get the principas that have a permission.
-
- Return the list of (principal_id, setting) tuples that describe
- security assertions for this permission.
-
- If no principals have been set for this permission, then the empty
- list is returned.
- """
-
- def getPermissionsForPrincipal(principal_id):
- """Get the permissions granted to a principal.
-
- Return the list of (permission, setting) tuples that describe
- security assertions for this principal.
-
- If no permissions have been set for this principal, then the empty
- list is returned.
- """
-
- def getSetting(permission_id, principal_id):
- """Get the setting for a permission and principal.
-
- Get the setting (Allow/Deny/Unset) for a given permission and
- principal.
- """
-
- def getPrincipalsAndPermissions():
- """Get all principal permission settings.
-
- Get the principal security assertions here in the form
- of a list of three tuple containing
- (permission id, principal id, setting)
- """
-
-
-class IPrincipalPermissionManager(IPrincipalPermissionMap):
- """Management interface for mappings between principals and permissions."""
-
- def grantPermissionToPrincipal(permission_id, principal_id):
- """Assert that the permission is allowed for the principal.
- """
-
- def denyPermissionToPrincipal(permission_id, principal_id):
- """Assert that the permission is denied to the principal.
- """
-
- def unsetPermissionForPrincipal(permission_id, principal_id):
- """Remove the permission (either denied or allowed) from the
- principal.
- """
More information about the Zope3-Checkins
mailing list