def getGroupById(self, group_id): """ Returns the portal_groupdata-ish object for a group corresponding to this id. """ if group_id and self.enumerateGroups(group_id): group = PloneGroup(group_id, None) plugins = self._getPAS()._getOb('plugins') propfinders = plugins.listPlugins(IPropertiesPlugin) for propfinder_id, propfinder in propfinders: data = propfinder.getPropertiesForUser(group, request=None) if data: group.addPropertysheet(propfinder_id, data) groups = self._getPAS()._getGroupsForPrincipal( group, request=None, plugins=plugins) group._addGroups(groups) rolemakers = plugins.listPlugins(IRolesPlugin) for rolemaker_id, rolemaker in rolemakers: roles = rolemaker.getRolesForPrincipal(group, request=None) if roles: group._addRoles(roles) group._addRoles(['Authenticated']) return group.__of__(self) else: return None
def getGroupById(self, group_id): """ Returns the portal_groupdata-ish object for a group corresponding to this id. """ if group_id and self.enumerateGroups(group_id): group = PloneGroup(group_id, None) plugins = self._getPAS()._getOb('plugins') propfinders = plugins.listPlugins(IPropertiesPlugin) for propfinder_id, propfinder in propfinders: data = propfinder.getPropertiesForUser(group, request=None) if data: group.addPropertysheet(propfinder_id, data) groups = self._getPAS()._getGroupsForPrincipal(group, request=None, plugins=plugins) group._addGroups(groups) rolemakers = plugins.listPlugins(IRolesPlugin) for rolemaker_id, rolemaker in rolemakers: roles = rolemaker.getRolesForPrincipal(group, request=None) if roles: group._addRoles(roles) group._addRoles(['Authenticated']) return group.__of__(self) else: return None
def getGroupById(self, groupid, default=None): group = PloneGroup(groupid) group = group.__of__(self) # add UserPropertySheet with title # We assume the title is the same as the id data = {'title': groupid} group.addPropertysheet(self.getId(), data) return group
def getGroupById(self, group_id): """ Returns the portal_groupdata-ish object for a group corresponding to this id. """ if group_id and self.enumerateGroups(group_id): group = PloneGroup(group_id, None) for name, data in self._get_properties_for_user_from_pas(group): group.addPropertysheet(name, data) for roles in self._get_roles_for_principal_from_pas(group): group._addRoles(roles) for groups in self._get_groups_for_principal_from_pas(group): group._addGroups(groups) group._addRoles(['Authenticated']) return group.__of__(self) else: return None