Mo' stringent permissions on the system job and system job template endpoints

This commit is contained in:
Matthew Jones
2014-10-30 10:24:47 -04:00
parent df4366bdba
commit 7699faae28

View File

@@ -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