mirror of
https://github.com/ansible/awx.git
synced 2026-04-07 02:59:21 -02:30
Merge pull request #10084 from jbradberry/revert-managed-by-tower-ee-lock
Revert the code that prevents sysadmins from changing managed EEs SUMMARY related #10078 ISSUE TYPE Bugfix Pull Request COMPONENT NAME API AWX VERSION awx: 19.1.0 Reviewed-by: Shane McDonald <me@shanemcd.com>
This commit is contained in:
@@ -685,7 +685,6 @@ class TeamAccessList(ResourceAccessList):
|
|||||||
|
|
||||||
class ExecutionEnvironmentList(ListCreateAPIView):
|
class ExecutionEnvironmentList(ListCreateAPIView):
|
||||||
|
|
||||||
always_allow_superuser = False
|
|
||||||
model = models.ExecutionEnvironment
|
model = models.ExecutionEnvironment
|
||||||
serializer_class = serializers.ExecutionEnvironmentSerializer
|
serializer_class = serializers.ExecutionEnvironmentSerializer
|
||||||
swagger_topic = "Execution Environments"
|
swagger_topic = "Execution Environments"
|
||||||
@@ -693,7 +692,6 @@ class ExecutionEnvironmentList(ListCreateAPIView):
|
|||||||
|
|
||||||
class ExecutionEnvironmentDetail(RetrieveUpdateDestroyAPIView):
|
class ExecutionEnvironmentDetail(RetrieveUpdateDestroyAPIView):
|
||||||
|
|
||||||
always_allow_superuser = False
|
|
||||||
model = models.ExecutionEnvironment
|
model = models.ExecutionEnvironment
|
||||||
serializer_class = serializers.ExecutionEnvironmentSerializer
|
serializer_class = serializers.ExecutionEnvironmentSerializer
|
||||||
swagger_topic = "Execution Environments"
|
swagger_topic = "Execution Environments"
|
||||||
|
|||||||
@@ -1356,11 +1356,8 @@ class ExecutionEnvironmentAccess(BaseAccess):
|
|||||||
return Organization.accessible_objects(self.user, 'execution_environment_admin_role').exists()
|
return Organization.accessible_objects(self.user, 'execution_environment_admin_role').exists()
|
||||||
return self.check_related('organization', Organization, data, mandatory=True, role_field='execution_environment_admin_role')
|
return self.check_related('organization', Organization, data, mandatory=True, role_field='execution_environment_admin_role')
|
||||||
|
|
||||||
|
@check_superuser
|
||||||
def can_change(self, obj, data):
|
def can_change(self, obj, data):
|
||||||
if obj.managed_by_tower:
|
|
||||||
raise PermissionDenied
|
|
||||||
if self.user.is_superuser:
|
|
||||||
return True
|
|
||||||
if obj and obj.organization_id is None:
|
if obj and obj.organization_id is None:
|
||||||
raise PermissionDenied
|
raise PermissionDenied
|
||||||
if self.user not in obj.organization.execution_environment_admin_role:
|
if self.user not in obj.organization.execution_environment_admin_role:
|
||||||
|
|||||||
Reference in New Issue
Block a user