from rest_framework import permissions


class IsWriterOrReadOnly(permissions.BasePermission):
    message = {'error': "작성한 본인만 작업할 수 있습니다."}

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

f6f2def3f816fa7fc88cdb6224c74ef933fd0a57
<mask token>


class IsWriterOrReadOnly(permissions.BasePermission):
    <mask token>
    <mask token>

<mask token>


class IsWriterOrReadOnly(permissions.BasePermission):
    <mask token>

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

<mask token>


class IsWriterOrReadOnly(permissions.BasePermission):
    message = {'error': '작성한 본인만 작업할 수 있습니다.'}

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

from rest_framework import permissions


class IsWriterOrReadOnly(permissions.BasePermission):
    message = {'error': '작성한 본인만 작업할 수 있습니다.'}

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

from rest_framework import permissions


class IsWriterOrReadOnly(permissions.BasePermission):
    message = {'error': "작성한 본인만 작업할 수 있습니다."}

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