File manager - Edit - /home/c14075/dragmet-ural.ru/www/bitrix/modules/iblock/lib/component/userfield/catalog/checkaccesstrait.php
Back
<?php namespace Bitrix\Iblock\Component\UserField\Catalog; use Bitrix\Catalog\Access\AccessController; use Bitrix\Catalog\Access\ActionDictionary; use Bitrix\Catalog\CatalogIblockTable; use Bitrix\Main\Loader; /** * Trait for checking access to catalog into UF components. */ trait CheckAccessTrait { /** * Checks access to catalog. * * @return bool */ protected function hasAccessToCatalog(): bool { if (!Loader::includeModule('catalog')) { return true; } $iblockId = (int)($this->arResult['userField']['SETTINGS']['IBLOCK_ID'] ?? 0); if ($iblockId <= 0) { return true; } $iblockIsCatalog = !empty(CatalogIblockTable::getByPrimary($iblockId)->fetch()); if (!$iblockIsCatalog) { return true; } return AccessController::getCurrent()->check(ActionDictionary::ACTION_CATALOG_READ); } }
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.27 |
proxy
|
phpinfo
|
Settings