Merge pull request #4323 from AlanCoding/team_singleton

Prohibit adding singleton permissions as child of team
This commit is contained in:
Alan Rominger
2016-12-07 10:10:31 -05:00
committed by GitHub
2 changed files with 12 additions and 0 deletions

View File

@@ -427,6 +427,9 @@ class Role(models.Model):
def is_ancestor_of(self, role):
return role.ancestors.filter(id=self.id).exists()
def is_singleton(self):
return self.singleton_name in [ROLE_SINGLETON_SYSTEM_ADMINISTRATOR, ROLE_SINGLETON_SYSTEM_AUDITOR]
class RoleAncestorEntry(models.Model):