mirror of
https://github.com/ansible/awx.git
synced 2026-01-12 02:19:58 -03:30
cleanup inventory admin access syntax
This commit is contained in:
parent
cae2cdaad8
commit
2afdc04ac0
@ -537,11 +537,8 @@ class InventoryAccess(BaseAccess):
|
||||
@check_superuser
|
||||
def can_admin(self, obj, data):
|
||||
# Verify that the user has access to the new organization if moving an
|
||||
# inventory to a new organization.
|
||||
if not self.check_related('organization', Organization, data, obj=obj):
|
||||
return False
|
||||
# Otherwise, just check for admin permission.
|
||||
return self.user in obj.admin_role
|
||||
# inventory to a new organization. Otherwise, just check for admin permission.
|
||||
return self.check_related('organization', Organization, data, obj=obj) and self.user in obj.admin_role
|
||||
|
||||
def can_delete(self, obj):
|
||||
is_can_admin = self.can_admin(obj, None)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user