Skip to content

Add warning regarding .as_view() with ViewSet action in the documentation - #9823

Merged
browniebroke merged 2 commits into
encode:mainfrom
mahdighadiriii:fix-9638-docs
Dec 9, 2025
Merged

browniebroke merged 2 commits into
encode:mainfrom
mahdighadiriii:fix-9638-docs

Conversation

@mahdighadiriii

@mahdighadiriii mahdighadiriii commented Nov 11, 2025 •

Copy link
Copy Markdown
Contributor

Problem

Users set permission_classes on @action methods, but when using .as_view(), these are ignored.
Fixes #9638

Example:

@action(detail=False, permission_classes=[IsAuthenticated])
def test_action(self, request): ...

@browniebroke browniebroke changed the title Improve viewset action docs - add .as_view() warning Add warning regarding .as_view() with VieSet actions in the documentation Dec 9, 2025
@browniebroke browniebroke changed the title Add warning regarding .as_view() with VieSet actions in the documentation Add warning regarding .as_view() with ViewSet action in the documentation Dec 9, 2025
@browniebroke
browniebroke merged commit cfc067b into encode:main Dec 9, 2025
@browniebroke

Copy link
Copy Markdown
Collaborator

Thanks!

@auvipy auvipy added this to the 3.17 milestone Dec 9, 2025
HosseinSayyedMousavi pushed a commit to HosseinSayyedMousavi/django-rest-framework that referenced this pull request Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

Improve viewset action docs

3 participants