from rest_framework.permissions import BasePermission


class IsAuthorOrIsAdmin(BasePermission):
    #create, list
    # def has_permission(self, request, view):

    #update, partial, destroy, retrieve
    def has_object_permission(self, request, view, obj):
        return request.user.is_staff or request.user == obj.author

f08ee2e799ab2d0c4186b961048615206056b844
<mask token>

<mask token>


class IsAuthorOrIsAdmin(BasePermission):
    <mask token>

<mask token>


class IsAuthorOrIsAdmin(BasePermission):

    def has_object_permission(self, request, view, obj):
        return request.user.is_staff or request.user == obj.author

from rest_framework.permissions import BasePermission


class IsAuthorOrIsAdmin(BasePermission):

    def has_object_permission(self, request, view, obj):
        return request.user.is_staff or request.user == obj.author

from rest_framework.permissions import BasePermission


class IsAuthorOrIsAdmin(BasePermission):
    #create, list
    # def has_permission(self, request, view):

    #update, partial, destroy, retrieve
    def has_object_permission(self, request, view, obj):
        return request.user.is_staff or request.user == obj.author
