from rest_framework import permissions
from rest_framework.exceptions import PermissionDenied


class CustomPerm(permissions.BasePermission):
    pass
How to return data with 403 error in Django Rest Framework?