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