      """
      Basic object level permissions utilizing django-guardian.
      """
  
      def __init__(self):
          assert guardian, 'Using DjangoObjectLevelModelPermissions, but django-guardian is not installed'
  
      action_perm_map = {
          'list': 'read',
          'retrieve': 'read',
          'create': 'add',
          'partial_update': 'change',
          'update': 'change',
          'destroy': 'delete',
      }
  
      def _get_model_name(self, view):
          model_cls = getattr(view, 'model', None)
          queryset = getattr(view, 'queryset', None)
 
</s> remove     def _get_model_name(self, view):
        model_cls = getattr(view, 'model', None)
        queryset = getattr(view, 'queryset', None)

        if model_cls is None and queryset is not None:
            model_cls = queryset.model
        if not model_cls:  # no model, no model based permissions
            return None
        model_name = model_cls._meta.module_name
        return model_name
 </s> add     def get_required_object_permissions(self, method, model_cls):
        kwargs = {
            'model_name': model_cls._meta.module_name
        }
        return [perm % kwargs for perm in self.actions_map[method]] </s> remove         action = self.action_perm_map.get(view.action)
        assert action, "Tried to determine object permissions but no action specified in view"
 </s> add         model_cls = getattr(view, 'model', None)
        queryset = getattr(view, 'queryset', None)

        if model_cls is None and queryset is not None:
            model_cls = queryset.model </s> remove         if view.action == 'list':
 </s> add         if getattr(view, 'action', None) == 'list': </s> remove         return user.has_perm(perm, obj)
 </s> add         return user.has_perms(perms, obj) </s> remove             object_permissions_view.cls.action = 'destroy'
 </s> add 
    actions_map = {
        'GET': ['read_%(model_name)s'],
        'OPTIONS': ['read_%(model_name)s'],
        'HEAD': ['read_%(model_name)s'],
        'POST': ['add_%(model_name)s'],
        'PUT': ['change_%(model_name)s'],
        'PATCH': ['change_%(model_name)s'],
        'DELETE': ['delete_%(model_name)s'],
      """
      Basic object level permissions utilizing django-guardian.
      """
  
    actions_map = {
        'GET': ['read_%(model_name)s'],
        'OPTIONS': ['read_%(model_name)s'],
        'HEAD': ['read_%(model_name)s'],
        'POST': ['add_%(model_name)s'],
        'PUT': ['change_%(model_name)s'],
        'PATCH': ['change_%(model_name)s'],
        'DELETE': ['delete_%(model_name)s'],
    actions_map = {
        'GET': ['read_%(model_name)s'],
        'OPTIONS': ['read_%(model_name)s'],
        'HEAD': ['read_%(model_name)s'],
        'POST': ['add_%(model_name)s'],
        'PUT': ['change_%(model_name)s'],
        'PATCH': ['change_%(model_name)s'],
        'DELETE': ['delete_%(model_name)s'],
    actions_map = {
        'GET': ['read_%(model_name)s'],
        'OPTIONS': ['read_%(model_name)s'],
        'HEAD': ['read_%(model_name)s'],
        'POST': ['add_%(model_name)s'],
        'PUT': ['change_%(model_name)s'],
        'PATCH': ['change_%(model_name)s'],
        'DELETE': ['delete_%(model_name)s'],
    actions_map = {
        'GET': ['read_%(model_name)s'],
        'OPTIONS': ['read_%(model_name)s'],
        'HEAD': ['read_%(model_name)s'],
        'POST': ['add_%(model_name)s'],
        'PUT': ['change_%(model_name)s'],
        'PATCH': ['change_%(model_name)s'],
        'DELETE': ['delete_%(model_name)s'],
    actions_map = {
        'GET': ['read_%(model_name)s'],
        'OPTIONS': ['read_%(model_name)s'],
        'HEAD': ['read_%(model_name)s'],
        'POST': ['add_%(model_name)s'],
        'PUT': ['change_%(model_name)s'],
        'PATCH': ['change_%(model_name)s'],
        'DELETE': ['delete_%(model_name)s'],
    actions_map = {
        'GET': ['read_%(model_name)s'],
        'OPTIONS': ['read_%(model_name)s'],
        'HEAD': ['read_%(model_name)s'],
        'POST': ['add_%(model_name)s'],
        'PUT': ['change_%(model_name)s'],
        'PATCH': ['change_%(model_name)s'],
        'DELETE': ['delete_%(model_name)s'],
    actions_map = {
        'GET': ['read_%(model_name)s'],
        'OPTIONS': ['read_%(model_name)s'],
        'HEAD': ['read_%(model_name)s'],
        'POST': ['add_%(model_name)s'],
        'PUT': ['change_%(model_name)s'],
        'PATCH': ['change_%(model_name)s'],
        'DELETE': ['delete_%(model_name)s'],
    actions_map = {
        'GET': ['read_%(model_name)s'],
        'OPTIONS': ['read_%(model_name)s'],
        'HEAD': ['read_%(model_name)s'],
        'POST': ['add_%(model_name)s'],
        'PUT': ['change_%(model_name)s'],
        'PATCH': ['change_%(model_name)s'],
        'DELETE': ['delete_%(model_name)s'],
    actions_map = {
        'GET': ['read_%(model_name)s'],
        'OPTIONS': ['read_%(model_name)s'],
        'HEAD': ['read_%(model_name)s'],
        'POST': ['add_%(model_name)s'],
        'PUT': ['change_%(model_name)s'],
        'PATCH': ['change_%(model_name)s'],
        'DELETE': ['delete_%(model_name)s'],
    actions_map = {
        'GET': ['read_%(model_name)s'],
        'OPTIONS': ['read_%(model_name)s'],
        'HEAD': ['read_%(model_name)s'],
        'POST': ['add_%(model_name)s'],
        'PUT': ['change_%(model_name)s'],
        'PATCH': ['change_%(model_name)s'],
        'DELETE': ['delete_%(model_name)s'],
      }
  
      def _get_model_name(self, view):
          model_cls = getattr(view, 'model', None)
          queryset = getattr(view, 'queryset', None)
keep keep keep keep replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
 removed unnecessary guardian req and view.action parsing 
rest_framework/permissions.py