mirror of
https://github.com/ansible/awx.git
synced 2026-01-21 22:48:02 -03:30
get_absolute_url implemenation for Role
This commit is contained in:
parent
5071dba4ff
commit
dce474ec5e
@ -20,7 +20,7 @@ __all__ = ['Role', 'RolePermission', 'Resource', 'ROLE_SINGLETON_SYSTEM_ADMINIST
|
||||
logger = logging.getLogger('awx.main.models.rbac')
|
||||
|
||||
ROLE_SINGLETON_SYSTEM_ADMINISTRATOR='System Administrator'
|
||||
ROLE_SINGLETON_SYSTEM_AUDITOR='System Auditor'
|
||||
ROLE_SINGLETON_SYSTEM_AUDITOR='System Auditor'
|
||||
|
||||
|
||||
class Role(CommonModelNameNotUnique):
|
||||
@ -45,6 +45,9 @@ class Role(CommonModelNameNotUnique):
|
||||
super(Role, self).save(*args, **kwargs)
|
||||
self.rebuild_role_ancestor_list()
|
||||
|
||||
def get_absolute_url(self):
|
||||
return reverse('api:role_detail', args=(self.pk,))
|
||||
|
||||
def rebuild_role_ancestor_list(self):
|
||||
'''
|
||||
Updates our `ancestors` map to accurately reflect all of the ancestors for a role
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user