mirror of
https://github.com/ansible/awx.git
synced 2026-05-13 04:17:36 -02:30
Turn off permissions check bypassing for admins when hitting the execution environment list and detail views.
This commit is contained in:
committed by
Shane McDonald
parent
5b2adc89cf
commit
b417fc3803
@@ -1329,13 +1329,10 @@ class ExecutionEnvironmentAccess(BaseAccess):
|
||||
Q(organization__isnull=True)
|
||||
).distinct()
|
||||
|
||||
@check_superuser
|
||||
def can_add(self, data):
|
||||
if not data: # So the browseable API will work
|
||||
return Organization.accessible_objects(self.user, 'execution_environment_admin_role').exists()
|
||||
if obj.managed_by_tower:
|
||||
raise PermissionDenied
|
||||
if self.user.is_superuser:
|
||||
return True
|
||||
return self.check_related('organization', Organization, data, mandatory=True,
|
||||
role_field='execution_environment_admin_role')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user