mirror of
https://github.com/ansible/awx.git
synced 2024-10-30 05:25:29 +03:00
Added Role.is_ancestor_of predicate
This commit is contained in:
parent
4540eb0079
commit
332b8b3b49
@ -84,6 +84,9 @@ class Role(CommonModelNameNotUnique):
|
||||
ret.save()
|
||||
return ret
|
||||
|
||||
def is_ancestor_of(self, role):
|
||||
return RoleHierarchy.objects.filter(role_id=role.id, ancestor_id=self.id).count() > 0
|
||||
|
||||
|
||||
|
||||
class RoleHierarchy(CreatedModifiedModel):
|
||||
|
Loading…
Reference in New Issue
Block a user