Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Commit

Permalink
user tests zouden moeten slagen
Browse files Browse the repository at this point in the history
  • Loading branch information
Vucis committed Mar 13, 2024
1 parent a3778df commit 1afb5b2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/project/utils/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ def authorize_teacher(f):
def wrap(*args, **kwargs):
auth_user_id = return_authenticated_user_id()
if is_teacher(auth_user_id):
kwargs["teacher_id"] = auth_user_id
return f(*args, **kwargs)
abort_with_message(403, "You are not authorized to perfom this action, only teachers are authorized")
return wrap
Expand Down Expand Up @@ -264,8 +265,7 @@ def authorize_user(f):
@wraps(f)
def wrap(*args, **kwargs):
auth_user_id = return_authenticated_user_id()
user_id = args["user_id"]

user_id = kwargs["user_id"]
if auth_user_id == user_id:
return f(*args, **kwargs)

Expand Down

0 comments on commit 1afb5b2

Please sign in to comment.