You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fromrest_frameworkimportstatus, permissionsclassIsOwnerOrReadOnly(permissions.BasePermission):
""" Custom permission to only allow owners of an object to edit it. """defhas_object_permission(self, request, view, obj):
# Read permissions are allowed to any request,# so we'll always allow GET, HEAD or OPTIONS requests.ifrequest.methodinpermissions.SAFE_METHODS:
returnTrue# Write permissions are only allowed to the owner of the snippet.returnobj.user==request.user
But When I make a POST/PUT request to insert or update many records, My ViewSet does not use Permission class to check permissions.
How to add permission classes to Bulk ViewSet ?
The text was updated successfully, but these errors were encountered:
I have a permisson class like this
and my ViewSet:
But When I make a POST/PUT request to insert or update many records, My ViewSet does not use Permission class to check permissions.
How to add permission classes to Bulk ViewSet ?
The text was updated successfully, but these errors were encountered: