mirror of
https://github.com/lemeow125/DocManagerBackend.git
synced 2025-01-19 09:33:01 +08:00
11 lines
264 B
Python
11 lines
264 B
Python
|
from rest_framework.permissions import BasePermission
|
||
|
|
||
|
|
||
|
class IsStaff(BasePermission):
|
||
|
"""
|
||
|
Allows access only to users with staff role
|
||
|
"""
|
||
|
|
||
|
def has_permission(self, request, view):
|
||
|
return bool(request.user and request.user.role == "staff")
|