mirror of
https://github.com/ansible/awx.git
synced 2026-02-27 07:56:06 -03:30
Mo' stringent permissions on the system job and system job template endpoints
This commit is contained in:
@@ -1720,6 +1720,11 @@ class SystemJobTemplateList(ListAPIView):
|
||||
model = SystemJobTemplate
|
||||
serializer_class = SystemJobTemplateSerializer
|
||||
|
||||
def get(self, request, *args, **kwargs):
|
||||
if not request.user.is_superuser:
|
||||
return Response(status=status.HTTP_404_NOT_FOUND)
|
||||
return super(SystemJobTemplateList, self).get(request, *args, **kwargs)
|
||||
|
||||
class SystemJobTemplateDetail(RetrieveAPIView):
|
||||
|
||||
model = SystemJobTemplate
|
||||
@@ -2174,6 +2179,12 @@ class SystemJobList(ListCreateAPIView):
|
||||
model = SystemJob
|
||||
serializer_class = SystemJobListSerializer
|
||||
|
||||
def get(self, request, *args, **kwargs):
|
||||
if not request.user.is_superuser:
|
||||
return Response(status=status.HTTP_404_NOT_FOUND)
|
||||
return super(SystemJobList, self).get(request, *args, **kwargs)
|
||||
|
||||
|
||||
class SystemJobDetail(RetrieveAPIView):
|
||||
|
||||
model = SystemJob
|
||||
|
||||
Reference in New Issue
Block a user