code: def has_permission(self, permission, obj=None):
          
          if not permission:
              logger.warn("None permission is not allowed")
              return False
          if obj is None:
              return check_permission(permission, self.context)
          return check_permission(permission, api.get_object(obj))
docs: Returns if the current user has rights for the permission passed in
  
          :param permission: permission identifier
          :param obj: object to check the permission against
          :return: True if the user has rights for the permission passed in