Skip to content

Commit

Permalink
cleanup for #131
Browse files Browse the repository at this point in the history
  • Loading branch information
DeLany123 committed Mar 29, 2024
1 parent 744f994 commit dea3159
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions backend/api/permissions/student_permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ class StudentPermission(IsAuthenticated):

def has_permission(self, request, view):
"""Check if user has permission to view a general student endpoint."""
if view.action in ['list', 'create', 'update', 'partial_update', 'destroy']:
return False
return True
return view.action == 'retrieve'

def has_object_permission(self, request, view, obj):
"""Check if user has permission to view a detailed group endpoint"""
Expand Down
4 changes: 1 addition & 3 deletions backend/api/permissions/teacher_permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ class TeacherPermission(IsAuthenticated):

def has_permission(self, request, view):
"""Check if user has permission to view a general Teacher endpoint."""
if view.action in ['list', 'create', 'update', 'partial_update', 'destroy']:
return False
return True
return view.action == 'retrieve'

def has_object_permission(self, request, view, obj):
"""Check if user has permission to view a detailed group endpoint"""
Expand Down

0 comments on commit dea3159

Please sign in to comment.