Exemplo n.º 1
0
 def description(self):
     content = self.content.get_silva_object()
     authorization = IAuthorizationManager(content, None)
     if authorization is None:
         return None
     information = authorization.get_authorization()
     return '{0} ({1})'.format(information.name, information.acquired_role)
Exemplo n.º 2
0
 def getItems(self):
     group_ids = self.store.get(GROUP_STORE_KEY, set())
     if group_ids:
         access = IAuthorizationManager(self.context)
         authorizations = access.get_authorizations(group_ids).items()
         authorizations.sort(key=operator.itemgetter(0))
         return filter(lambda auth: auth.type == 'group',
                       map(operator.itemgetter(1), authorizations))
     return []
Exemplo n.º 3
0
 def getItems(self):
     access = IAuthorizationManager(self.context)
     authorizations = access.get_defined_authorizations().items()
     authorizations.sort(key=operator.itemgetter(0))
     return filter(lambda auth: auth.type == 'group',
                   map(operator.itemgetter(1), authorizations))