CCrmDealRestProxy::innerDelete

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CCrmDealRestProxy
  4. innerDelete
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/restservice.php
  • Класс: \CCrmDealRestProxy
  • Вызов: CCrmDealRestProxy::innerDelete
protected function innerDelete($ID, &$errors, array $params = null)
{
	$userPermissions = CCrmPerms::GetCurrentUserPermissions();
	$categoryID = CCrmDeal::GetCategoryID($ID);
	if($categoryID < 0)
	{
		$errors[] = !CCrmDeal::CheckDeletePermission(0, $userPermissions) ? 'Access denied' : 'Not found';
		return false;
	}
	elseif(!CCrmDeal::CheckDeletePermission($ID, $userPermissions, $categoryID))
	{
		$errors[] = 'Access denied.';
		return false;
	}

	$entity = self::getEntity(false);
	$result = $entity->Delete($ID);
	if($result !== true)
	{
		$errors[] = $entity->LAST_ERROR;
	}

	return $result;
}

Добавить комментарий