• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/controller/timeline/item.php
  • Класс: Bitrix\Crm\Controller\Timeline\Item
  • Вызов: Item::checkBinding
private function checkBinding(int $id, int $ownerTypeId, int $ownerId): bool
{
	if(!\CCrmOwnerType::IsDefined($ownerTypeId) || $ownerId <= 0)
	{
		$this->addError(\Bitrix\Crm\Controller\ErrorCode::getOwnerNotFoundError());

		return false;
	}

	$permissions = Container::getInstance()->getUserPermissions();
	if (!$permissions->checkUpdatePermissions($ownerTypeId, $ownerId))
	{
		$this->addError(\Bitrix\Crm\Controller\ErrorCode::getAccessDeniedError());

		return false;
	}

	if (!\Bitrix\Crm\Timeline\TimelineEntry::checkBindingExists($id, $ownerTypeId, $ownerId))
	{
		$this->addError(\Bitrix\Crm\Controller\ErrorCode::getNotFoundError());

		return false;
	}

	return true;
}