Exemplo n.º 1
0
    def _set_group(self, new_group, current_groups):
        """
        Helper method to change ownership from a possible collection of
        groups to a single other group.
        """
        already_member = False
        for gname in current_groups:
            if gname == new_group:
                already_member = True
                continue
            grp = srusers.group(gname)
            if self.username in grp.members:
                grp.user_rm(self.username)
                self._modified_groups.add(grp)

        if not already_member:
            new_grp = srusers.group(new_group)
            new_grp.user_add(self.username)
            self._modified_groups.add(new_grp)
Exemplo n.º 2
0
    def _set_group(self, new_group, current_groups):
        """
        Helper method to change ownership from a possible collection of
        groups to a single other group.
        """
        already_member = False
        for gname in current_groups:
            if gname == new_group:
                already_member = True
                continue
            grp = srusers.group(gname)
            if self.username in grp.members:
                grp.user_rm(self.username)
                self._modified_groups.add(grp)

        if not already_member:
            new_grp = srusers.group(new_group)
            new_grp.user_add(self.username)
            self._modified_groups.add(new_grp)
Exemplo n.º 3
0
 def delete(self):
     for gid in self._user.groups():
         g = srusers.group(gid)
         g.user_rm(self.username)
         g.save()
     self._user.delete()
Exemplo n.º 4
0
 def __init__(self, group_name):
     self._group = srusers.group(group_name)
     self.group_name = group_name
Exemplo n.º 5
0
 def delete(self):
     for gid in self._user.groups():
         g = srusers.group(gid)
         g.user_rm(self.username)
         g.save()
     self._user.delete()
Exemplo n.º 6
0
    def _group(self):
        if self._cached_group is None:
            self._cached_group = srusers.group(self._group_name)

        return self._cached_group
Exemplo n.º 7
0
 def __init__(self, group_name):
     self._group = srusers.group(group_name)
     self.group_name = group_name
Exemplo n.º 8
0
 def __init__(self, name):
     self._group = srusers.group(name)
     self.name = name
Exemplo n.º 9
0
    def _group(self):
        if self._cached_group is None:
            self._cached_group = srusers.group(self._group_name)

        return self._cached_group
Exemplo n.º 10
0
 def __init__(self, name):
     self._group = srusers.group(name)
     self.name = name