<reponame>mupastir/social_network<gh_stars>1-10
from rest_framework import permissions


class ObjectAuthorPermission(permissions.BasePermission):

    def has_object_permission(self, request, view, obj):
        if obj.author and request.user == obj.author:
            return True
        return False

from rest_framework import permissions


class ObjectAuthorPermission(permissions.BasePermission):

    def has_object_permission(self, request, view, obj):
        if obj.author and request.user == obj.author:
            return True
        return False