from rest_framework.permissions import BasePermission, SAFE_METHODS


class IsOwnerOrReadOnly(BasePermission):

    def has_object_permission(self, request, view, obj):
        print(request.method, SAFE_METHODS)
        if request.method in SAFE_METHODS:
            return True
        print(request.user)
        print(obj.owner)
        return request.user == obj.owner

5664bc2a3cf1bd85dff4bfdbf9f7eb94759f6df9
<mask token>

<mask token>


class IsOwnerOrReadOnly(BasePermission):
    <mask token>

<mask token>


class IsOwnerOrReadOnly(BasePermission):

    def has_object_permission(self, request, view, obj):
        print(request.method, SAFE_METHODS)
        if request.method in SAFE_METHODS:
            return True
        print(request.user)
        print(obj.owner)
        return request.user == obj.owner

from rest_framework.permissions import BasePermission, SAFE_METHODS


class IsOwnerOrReadOnly(BasePermission):

    def has_object_permission(self, request, view, obj):
        print(request.method, SAFE_METHODS)
        if request.method in SAFE_METHODS:
            return True
        print(request.user)
        print(obj.owner)
        return request.user == obj.owner
