def has_object_permission(self, request, view, obj):
    if request.user.is_staff:
        return True
raise PermissionDenied({'message': "You don't have permission to access",
    'object_id': obj.id})
How to return data with 403 error in Django Rest Framework?