first commit
This commit is contained in:
9
core/utils/Permission.py
Normal file
9
core/utils/Permission.py
Normal file
@@ -0,0 +1,9 @@
|
||||
from rest_framework.permissions import BasePermission, SAFE_METHODS
|
||||
|
||||
class ReadOnly(BasePermission):
|
||||
"""
|
||||
Yalnızca okuma işlemlerine izin verir.
|
||||
"""
|
||||
def has_permission(self, request, view):
|
||||
# SAFE_METHODS: ('GET', 'HEAD', 'OPTIONS')
|
||||
return request.method in SAFE_METHODS
|
||||
Reference in New Issue
Block a user