Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix security vulnerability for Hub API #489

Merged
merged 1 commit into from
Nov 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading