mirror of
https://github.com/ansible/awx.git
synced 2026-02-25 15:06:02 -03: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):
|
||||
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)
|
||||
|
||||
class SystemJobTemplateDetail(RetrieveAPIView):
|
||||
@@ -3212,7 +3212,7 @@ class SystemJobList(ListCreateAPIView):
|
||||
|
||||
def get(self, request, *args, **kwargs):
|
||||
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)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user