def __init__(self, name, site=None, members=None): self._name = _str(name) self._site = site if site is not None else getSite() self._acl_users = self._site.acl_users self._introspection = pas.group_introspection_plugins(self._acl_users) self._management = pas.group_management_plugins(self._acl_users)[0] self._init_info() self._members = self._members_adapter(members) self.refresh()
def __init__(self, context=None): if context is None: context = getSite() if not ISiteRoot.providedBy(context): raise TypeError('context must be site root') self.context = context self._acl_users = self.context.acl_users self._enumeration = pas.group_enumeration_plugins(self._acl_users) self._management = pas.group_management_plugins(self._acl_users)[0] self.refresh()
def __init__(self, name, site=None, members=None): self._name = _str(name) self._site = site if site is not None else getSite() self._acl_users = self._site.acl_users self._introspection = pas.group_introspection_plugins(self._acl_users) self._management = pas.group_management_plugins(self._acl_users)[0] self._init_info() self._members = self._members_adapter(members) self.refresh() _group_invalidation.subscribe(name, self)
def create(cls, name, title=None, description=None, site=None): name = _str(name) site = site if site is not None else getSite() management = pas.group_management_plugins(site.acl_users)[0] management.addGroup(name, title, description) return GroupInfo(name, site)