mirror of
https://github.com/ansible/awx.git
synced 2026-03-24 04:15:02 -02:30
change 404 errors to PermissionDenied for those with links
This commit is contained in:
@@ -2482,7 +2482,7 @@ class SystemJobTemplateList(ListAPIView):
|
|||||||
|
|
||||||
def get(self, request, *args, **kwargs):
|
def get(self, request, *args, **kwargs):
|
||||||
if not request.user.is_superuser:
|
if not request.user.is_superuser:
|
||||||
return Response(status=status.HTTP_404_NOT_FOUND)
|
raise PermissionDenied("Superuser privileges needed")
|
||||||
return super(SystemJobTemplateList, self).get(request, *args, **kwargs)
|
return super(SystemJobTemplateList, self).get(request, *args, **kwargs)
|
||||||
|
|
||||||
class SystemJobTemplateDetail(RetrieveAPIView):
|
class SystemJobTemplateDetail(RetrieveAPIView):
|
||||||
@@ -3212,7 +3212,7 @@ class SystemJobList(ListCreateAPIView):
|
|||||||
|
|
||||||
def get(self, request, *args, **kwargs):
|
def get(self, request, *args, **kwargs):
|
||||||
if not request.user.is_superuser:
|
if not request.user.is_superuser:
|
||||||
return Response(status=status.HTTP_404_NOT_FOUND)
|
raise PermissionDenied("Superuser privileges needed")
|
||||||
return super(SystemJobList, self).get(request, *args, **kwargs)
|
return super(SystemJobList, self).get(request, *args, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user