Ejemplo n.º 1
0
 def get_group_perm(self, user_id):
     from models.team_group import ProjectGroup
     pgs = ProjectGroup.gets(project_id=self.id)
     perm = None
     for pg in pgs:
         g = pg.group
         if not g:
             continue
         if g.is_member(user_id):
             perm = perm if perm and perm > g.permission else g.permission
     return perm
Ejemplo n.º 2
0
 def groups(self):
     from models.team_group import ProjectGroup
     rs = ProjectGroup.gets(project_id=self.id)
     return [r.group for r in rs]