Product::checkPermissionIBlockElementDelete

  1. Bitrix24 API (v. 23.675.0)
  2. catalog
  3. Product
  4. checkPermissionIBlockElementDelete
  • Модуль: catalog
  • Путь к файлу: ~/bitrix/modules/catalog/lib/controller/product.php
  • Класс: BitrixCatalogControllerProduct
  • Вызов: Product::checkPermissionIBlockElementDelete
protected function checkPermissionIBlockElementDelete(int $elementId): Result
{
	$iblockId = (int)CIBlockElement::GetIBlockByID($elementId);

	$r = $this->existsIblock($iblockId);
	if (!$r->isSuccess())
	{
		return $r;
	}

	if (!CIBlockElementRights::UserHasRightTo($iblockId, $elementId, self::IBLOCK_ELEMENT_DELETE)) //access delete
	{
		$r->addError(new Error('Access Denied', 200040300040));
	}

	return $r;
}

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