mirror of
https://github.com/ansible/awx.git
synced 2026-03-11 06:29:31 -02: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
|
model = SystemJobTemplate
|
||||||
serializer_class = SystemJobTemplateSerializer
|
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):
|
class SystemJobTemplateDetail(RetrieveAPIView):
|
||||||
|
|
||||||
model = SystemJobTemplate
|
model = SystemJobTemplate
|
||||||
@@ -2174,6 +2179,12 @@ class SystemJobList(ListCreateAPIView):
|
|||||||
model = SystemJob
|
model = SystemJob
|
||||||
serializer_class = SystemJobListSerializer
|
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):
|
class SystemJobDetail(RetrieveAPIView):
|
||||||
|
|
||||||
model = SystemJob
|
model = SystemJob
|
||||||
|
|||||||
Reference in New Issue
Block a user