Beispiel #1
0
def sync_group_roles(context, groupname):
    """
    Given a group name as a full PAS groupname, infer appropriate
    roles for that group based on configuration, and bind those
    local roles to the context.
    """
    always_inherit_local_roles(context)
    manager = LocalRolesView(context, request_for(context))
    if IProjectContext.providedBy(context):
        roles = _project_roles_for(groupname)
    else:
        roles = _workspace_roles_for(groupname)
    manager.update_role_settings([grouproles(groupname, roles)])
Beispiel #2
0
 def __init__(self, context=None, request=None):
     self.portal = self.context = context
     if not ISiteRoot.providedBy(context):
         self.context = self.portal = getSite()
     self.request = request
     if request is None:
         # use a fake request suitable for making CMF tools happy
         self.request = request_for(self.context)
     self.status = IStatusMessage(self.request)
     self._uf = getToolByName(self.context, 'acl_users')
     self._enumerators = pas.enumeration_plugins(self._uf)
     self._management = pas.management_plugins(self._uf)
     self.refresh()
     self._groups = None