mirror of
https://github.com/lemeow125/Borrowing-TrackerBackend.git
synced 2025-04-27 10:11:24 +08:00
Fix is student permission and add viewsets for teachers and students for viewing transactions assigned to them
This commit is contained in:
parent
938614fafa
commit
d5dbe2b876
4 changed files with 65 additions and 2 deletions
|
@ -25,7 +25,7 @@ class IsStudent(BasePermission):
|
|||
message = "You must be a student to perform this action."
|
||||
|
||||
def has_permission(self, request, view):
|
||||
return request.user.is_authenticated and request.user.is_student
|
||||
return request.user.is_authenticated and (not request.user.is_teacher and not request.user.is_technician)
|
||||
|
||||
def has_object_permission(self, request, view, obj):
|
||||
return request.user.is_authenticated and request.user.is_student
|
||||
return request.user.is_authenticated and (not request.user.is_teacher and not request.user.is_technician)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue