title: Django rest framework queryset custom permissions
body: <p>I would like to set custom permissions with django guardian on my django rest framework views. I've successfuly achieved it for <code>RetrieveModelMixin</code>, but not for <code>ListModelMixin</code>.</p>
  
  <p>I have a permission class looking like this one :</p>
  
  <pre><code>class CustomPerm(permissions.BasePermission):
      def has_permission(self, request, view):
          return request.user and request.user.is_authenticated()
  
      def has_object_permission(self, request, view, object):
          if request.method == 'GET':
              if object.public is True:
                  return True
  
              if object.user.is_staff is True:
                  return True
  
              if 'read_object' in get_perms(request.user, object):
                  return True
  
              return False
  
          if request.method == 'POST':
              #...
  </code></pre>
  
  <p>I also simplified the view here :</p>
  
  <pre><code>@authentication_classes((TokenAuthentication, SessionAuthentication, BasicAuthentication,))
  @permission_classes((CustomPerm,))
  class ObjectView(ListModelMixin,
                   RetrieveModelMixin,
                   viewsets.GenericViewSet):
      queryset = myObject.objects.all()
      serializer_class = ObjectSerializer
  </code></pre>
  
  <p>Behaviour I was naïvly expecting : <code>ListModelMixin</code> could filter by itself objects according to CustomPerm <code>has_object_permission</code> rules.</p>
  
  <p>But it does not work like that. I'm able to do what I want by writing a <code>get_queryset</code> method and applying my custom permission rules, but it seems unappropriate and awful.</p>
  
  <p>Is there a better way ? Thanks :)</p>
  
  <p>PS: I'm sure I'm missing something and my question is naïve but I can't see what.</p>