Skip to content

Commit

Permalink
update project views and permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
Evgeniy-Golodnykh committed Aug 6, 2024
1 parent a66a33f commit 5c633dd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions blackfox/api/permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class IsAdmin(permissions.BasePermission):
message = 'Only admin can perform this.'

def has_permission(self, request, view):
return request.user.is_authenticated and request.user.role == 'admin'
return request.user.is_authenticated and request.user.is_admin


class IsCoach(permissions.BasePermission):
Expand All @@ -16,4 +16,4 @@ class IsCoach(permissions.BasePermission):
message = 'Only coach can perform this.'

def has_permission(self, request, view):
return request.user.is_authenticated and request.user.role == 'coach'
return request.user.is_authenticated and request.user.is_coach
Binary file modified blackfox/db.sqlite3
Binary file not shown.

0 comments on commit 5c633dd

Please sign in to comment.