def listUserGroups(self, user):
        """Return a list of current groups joined by this user

        @param user: user name, or User object
        @rtype: Group list
        @return: list of Groups user belongs to"""
        return tuple(Group.create(name, self._modelDataManager) for name in self.pm_getUserManager().listUserGroups(self._unbox(user)))
    def addGroup(self, name):
        """Create a Group

        @param name: group name
        @rtype: Group
        @return: newly created Group"""
        return Group.create(self.pm_getUserManager().addGroup(name), self._modelDataManager)
Beispiel #3
0
    def addGroup(self, name):
        """Create a Group

        @param name: group name
        @rtype: Group
        @return: newly created Group"""
        return Group.create(self.pm_getUserManager().addGroup(name),
                            self._modelDataManager)
Beispiel #4
0
    def listGroups(self):
        """Return a list of available groups

        @rtype: Group List
        @return: list of available Groups"""
        return tuple(
            Group.create(groupName, self._modelDataManager)
            for groupName in self.pm_getUserManager().listGroups())
Beispiel #5
0
    def getGroup(self, name):
        """Return a Group object

        @param name: group name
        @rtype: Group"""
        return Group.create(
            self.pm_getUserManager().getGroup(self._unbox(name)),
            self._modelDataManager)
Beispiel #6
0
    def listUserGroups(self, user):
        """Return a list of current groups joined by this user

        @param user: user name, or User object
        @rtype: Group list
        @return: list of Groups user belongs to"""
        return tuple(
            Group.create(name, self._modelDataManager)
            for name in self.pm_getUserManager().listUserGroups(
                self._unbox(user)))
    def listGroups(self):
        """Return a list of available groups

        @rtype: Group List
        @return: list of available Groups"""
        return tuple(Group.create(groupName, self._modelDataManager) for groupName in self.pm_getUserManager().listGroups())
    def getGroup(self, name):
        """Return a Group object

        @param name: group name
        @rtype: Group"""
        return Group.create(self.pm_getUserManager().getGroup(self._unbox(name)), self._modelDataManager)
Beispiel #9
0
def create_group(group_name):
    Group.create(group_name)
    resp = jsonify(status="OK", group_name=group_name)
    resp.status_code = 201
    return resp