title: Django Rest Framework: Change Serializer or Add Field Based on Authentication
body: <p>I have a viewset as follows:</p>
  
  <pre><code>class CardViewSet(viewsets.ReadOnlyModelViewSet):
      """
      Standard Viewset for listing cards
      """
      pagination_class = StandardCellSetPagination
      permission_classes = [AllowAny, IsAuthenticated]
  
      def list(self, request):
          queryset = Card.objects.exclude(reply_to__isnull=False).order_by('-created')
          cards = self.paginate_queryset(queryset)
          serializer = CardCellSerializer(cards, many=True)
          return self.get_paginated_response(serializer.data)
  
      def retrieve(self, request, pk=None):
          queryset = Card.objects.all()
          card = get_object_or_404(queryset, pk=pk)
          serializer = CardSerializer(card)
          return Response(serializer.data)
  </code></pre>
  
  <p>My serializer for the CardSerializer is:</p>
  
  <pre><code>class CardSerializer(serializers.ModelSerializer):
      class Meta:
          model = Card
  </code></pre>
  
  <p>How do I either</p>
  
  <ul>
  <li>Change the serializer for the retrieve method if the viewset has the permission <code>IsAuthenticated</code>?
  OR </li>
  <li>Add a field to the <code>CardSerializer</code> if viewset has <code>IsAuthenticated</code>?</li>
  </ul>
  
  <p>Such that I can return <code>True / False</code> if a user has favorited the card via a <code>SerializerMethodField</code></p>