[Django]-How can I get an access to url paramaters in django rest framework permission class?

18👍

Try this:

class IsOwnerOrCuratorOrDirectorOrNotAllowed(permissions.BasePermission):
    def has_permission(self, request, view):
        user_pk = view.kwargs.get('user_pk', None)
        ...

Leave a comment