Skip to content

Commit

Permalink
Permission middelware (#806)
Browse files Browse the repository at this point in the history
* added a check for existing user and id on request

* format
  • Loading branch information
MadsNyl committed Jun 9, 2024
1 parent e30f102 commit 64d717c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/common/permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ def check_has_access(groups_with_access, request):


def set_user_id(request):
# If the id and user of the request is already set, return
if (hasattr(request, "id") and request.id) and (
hasattr(request, "user") and request.user
):
return

token = request.META.get("HTTP_X_CSRF_TOKEN")
request.id = None
request.user = None
Expand Down

0 comments on commit 64d717c

Please sign in to comment.