How to access named url arguments in permissions with Django REST Framework?
This is the wrong approach. Rather than trying to access keyword arguments there, you should be using object-level permissions and checking has_object_permission
in your permission class.
You can find them in:
request.resolver_match.kwargs.get('attribute_name')
you can access from the view.kwargs.