<s> from rest_framework import permissions <EOL> class IsOwnerOrReadOnly ( permissions . BasePermission ) : <EOL> def has_object_permission ( self , request , view , obj ) : <EOL> if request . method in permissions . SAFE_METHODS : <EOL> return True <EOL> return obj . is_owner ( request . user ) </s>
