adhocracy_core.authorization package¶
Authorization with roles/local roles mapped to adhocracy principals.
Marker interface for extension acm of the application root.
Dummy adpater to extend the root_acm.
Bases:
pyramid.authorization.ACLAuthorizationPolicyA authorization policy supporting creator term:local role.
Check permission for context. Read interface docstring.
Set the local role’s mapping to
new_local_roles.Parameters: new_local_roles ( dict) –Mapping from groupid/userid to a set of roles for the resource:
{‘system.Everyone’: {‘role:reader’}}
If the resource’s local roles and the
new_local_rolesdiffer, set thenew_local_rolesvia setattr and send aadhocracy_core.interfaces.ILocalRolesModifiedto notify others. The ACL of the resource in updated with the permissions added by the local roles.
Add roles to existing :term:`local role’s mapping.
Return the local roles of the resource.
Return the local roles of the resource and its parents.
The creator role is ignored.
Convert an Access Control Matrix into a pyramid ACL.
To avoid generating too many ACE, action which are None will not generate an ACE.
Permissions for principals with high priority are listed first and override succeding permissions. The order is determined by
adhocracy_core.schema.ROLE_PRINCIPALS. Pricipals with higher index in this list have higher priority.
Set/update :term:`acm`s for the root object of the pyramid application.
Parameters: event – this function should be used as a subscriber for the pyramid.interfaces.IApplicationCreatedevent. That way everytime the application starts the root acm is updated.The root_acm (
root_acm_asset()) is extended by the acm returned by theadhocracy_core.authorization.IRootACMExtensionadapter.In addition all permissions are granted the god user.
Create a fake request issued by god.
Return the ACL of the resource.
Return ACL of the resource inclusive inherited acl.
Add local_roles and set the term:ACL of the resource.
Every ACE in the acl has to be a list of 3 strings. Permission given by local_role are added to the existing acl. Manually adding ACEs containing group principals is not allowed, as are used for local_role permissions.
Check if the sheets requires a password for editing.
Check if some of the sheets require a password for editing.
Register adapter to extend the root acm and add authorization policy.