Skip to content

Commit

Permalink
chore: i forgor 💀
Browse files Browse the repository at this point in the history
  • Loading branch information
EwoutV committed May 24, 2024
1 parent 4015c4e commit b5e73d2
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions backend/api/permissions/submission_permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,14 @@ class SubmissionFeedbackPermission(SubmissionPermission):
def has_permission(self, request: Request, view: APIView) -> bool:
return True

def has_object_permission(self, request: Request, view: APIView, obj: Submission) -> bool:
return True
def has_object_permission(self, request: Request, view: APIView, submission: Submission) -> bool:
if is_student(request.user) and submission.group.students.contains(request.user):
return True

if is_teacher(request.user) or is_assistant(request.user):
return True

return False


class StructureCheckResultPermission(SubmissionPermission):
Expand Down

0 comments on commit b5e73d2

Please sign in to comment.