old_contents: # -*- coding: utf-8 -*-
  #
  # Newfies-Dialer License
  # http://www.newfies-dialer.org
  #
  # This Source Code Form is subject to the terms of the Mozilla Public
  # License, v. 2.0. If a copy of the MPL was not distributed with this file,
  # You can obtain one at http://mozilla.org/MPL/2.0/.
  #
  # Copyright (C) 2011-2013 Star2Billing S.L.
  #
  # The Initial Developer of the Original Code is
  # Arezqui Belaid <info@star2billing.com>
  #
  from rest_framework.permissions import DjangoObjectPermissions
  
  
  class CustomObjectPermissions(DjangoObjectPermissions):
      """
      Similar to `DjangoObjectPermissions`, but adding 'view' permissions.
      """
      perms_map = {
          'GET': ['%(app_label)s.view_%(model_name)s'],
          'OPTIONS': ['%(app_label)s.view_%(model_name)s'],
          'HEAD': ['%(app_label)s.view_%(model_name)s'],
          'POST': ['%(app_label)s.add_%(model_name)s'],
          'PUT': ['%(app_label)s.change_%(model_name)s'],
          'PATCH': ['%(app_label)s.change_%(model_name)s'],
          'DELETE': ['%(app_label)s.delete_%(model_name)s'],
      }
  
new_contents: # -*- coding: utf-8 -*-
  #
  # Newfies-Dialer License
  # http://www.newfies-dialer.org
  #
  # This Source Code Form is subject to the terms of the Mozilla Public
  # License, v. 2.0. If a copy of the MPL was not distributed with this file,
  # You can obtain one at http://mozilla.org/MPL/2.0/.
  #
  # Copyright (C) 2011-2013 Star2Billing S.L.
  #
  # The Initial Developer of the Original Code is
  # Arezqui Belaid <info@star2billing.com>
  #
  from rest_framework.permissions import DjangoModelPermissions  # DjangoObjectPermissions
  
  
  class CustomObjectPermissions(DjangoModelPermissions):
      """
      Similar to `DjangoModelPermissions`, but adding 'view' permissions.
      """
      perms_map = {
          'GET': ['%(app_label)s.view_%(model_name)s'],
          'OPTIONS': ['%(app_label)s.view_%(model_name)s'],
          'HEAD': ['%(app_label)s.view_%(model_name)s'],
          'POST': ['%(app_label)s.add_%(model_name)s'],
          'PUT': ['%(app_label)s.change_%(model_name)s'],
          'PATCH': ['%(app_label)s.change_%(model_name)s'],
          'DELETE': ['%(app_label)s.delete_%(model_name)s'],
      }
  
subject: fix permission class on restapi