Skip to content

Commit

Permalink
Fix security vulnerability for Hub API
Browse files Browse the repository at this point in the history
  • Loading branch information
Xpirix committed Nov 21, 2024
1 parent 320e56f commit 7882b76
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions qgis-app/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ def get(self, request, *args, **kwargs):
object = _get_resource_object(uuid, resource_type)
if object is None:
raise Http404
if not object.creator.is_staff and object.creator != request.user:
if not request.user.is_superuser and object.creator != request.user:
return Response(
{"detail": "You do not have permission to perform this action."},
status=status.HTTP_403_FORBIDDEN,
Expand All @@ -436,7 +436,7 @@ def put(self, request, *args, **kwargs):
object = _get_resource_object(uuid, resource_type)
if object is None:
raise Http404
if not object.creator.is_staff and object.creator != request.user:
if not request.user.is_superuser and object.creator != request.user:
return Response(
{"detail": "You do not have permission to perform this action."},
status=status.HTTP_403_FORBIDDEN,
Expand All @@ -453,7 +453,7 @@ def delete(self, request, *args, **kwargs):
object = _get_resource_object(uuid, resource_type)
if object is None:
raise Http404
if not object.creator.is_staff and object.creator != request.user:
if not request.user.is_superuser and object.creator != request.user:
return Response(
{"detail": "You do not have permission to perform this action."},
status=status.HTTP_403_FORBIDDEN,
Expand Down

0 comments on commit 7882b76

Please sign in to comment.