Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to use drf permission class with class method actions

class SandwichViewSet(ModelViewSet):
  permission_classes = [IsAuthenticated]

  @action(..., permission_classes=[CanSeeIngredients])
  def retrieve__ingredients(self, request):
    ...
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #drf #permission #class #class #method #actions
ADD COMMENT
Topic
Name
7+9 =