kwork-poizonstore/utils/permissions.py
phzhik 859051a969 + statistics by clients
+ cdek_tracking
+ checklist create API
+ some permissions
* Cleanup
2023-07-05 02:19:58 +04:00

15 lines
473 B
Python

from rest_framework import permissions
from rest_framework.authentication import SessionAuthentication
from rest_framework.permissions import BasePermission, SAFE_METHODS
class CsrfExemptSessionAuthentication(SessionAuthentication):
def enforce_csrf(self, request):
# To not perform the csrf check previously happening
return
class ReadOnly(BasePermission):
def has_permission(self, request, view):
return request.method in SAFE_METHODS