DocManagerBackend/docmanager_backend/documents/permissions.py

11 lines
264 B
Python
Raw Normal View History

2024-11-23 23:02:52 +08:00
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")