Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from rest_framework import permissions
- class IsAuthorOrReadOnlyPermission(permissions.BasePermission):
- def has_object_permission(self, request, view, obj):
- return request.method in permissions.SAFE_METHODS or obj.author == request.user
Advertisement
Add Comment
Please, Sign In to add comment