diff --git a/backend/api/permissions/course_permissions.py b/backend/api/permissions/course_permissions.py index 7f88d7a9..5bce23e7 100644 --- a/backend/api/permissions/course_permissions.py +++ b/backend/api/permissions/course_permissions.py @@ -49,6 +49,8 @@ def has_object_permission(self, request: Request, view: ViewSet, course: Course) class CourseStudentPermission(CoursePermission): """Permission class for student related endpoints.""" + def has_permission(self, request: Request, view: ViewSet) -> bool: + return request.user and request.user.is_authenticated def has_object_permission(self, request: Request, view: ViewSet, course: Course): user: User = request.user @@ -67,6 +69,8 @@ def has_object_permission(self, request: Request, view: ViewSet, course: Course) class CourseProjectPermission(CoursePermission): """Permission class for project related endpoints.""" + def has_permission(self, request: Request, view: ViewSet) -> bool: + return request.user and request.user.is_authenticated def has_object_permission(self, request: Request, view: ViewSet, course: Course): user: User = request.user