  
  from django.http import Http404
  from rest_framework.compat import oauth2_provider_scope, oauth2_constants, guardian
  
  
  class BasePermission(object):
      """
      A base class from which all permission classes should inherit.
      """
 
</s> remove from rest_framework.compat import django_filters, six
 </s> add from rest_framework.compat import django_filters, six, guardian </s> remove         user = request.user
        model_name = self._get_names(view)
 </s> add  </s> remove             model_name = self._get_names(view)
            view.queryset = guardian.shortcuts.get_objects_for_user(user, 'read_' + model_name, queryset)  #TODO: move to filter
 </s> add             view.queryset = ObjectPermissionReaderFilter().filter_queryset(request, queryset, view)
from rest_framework.filters import ObjectPermissionReaderFilter
  
  from django.http import Http404
  from rest_framework.compat import oauth2_provider_scope, oauth2_constants, guardian
from rest_framework.filters import ObjectPermissionReaderFilter
  
  
  class BasePermission(object):
      """
      A base class from which all permission classes should inherit.
      """
keep keep add keep keep keep keep keep keep
 switch to a dedicated filter for read list object permissions 
rest_framework/permissions.py