1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
checkaccesstrait.php
См. документацию.
1<?php
2
4
9
13trait CheckAccessTrait
14{
20 protected function hasAccessToCatalog(): bool
21 {
22 if (!Loader::includeModule('catalog'))
23 {
24 return true;
25 }
26
27 $iblockId = (int)($this->arResult['userField']['SETTINGS']['IBLOCK_ID'] ?? 0);
28 if ($iblockId <= 0)
29 {
30 return true;
31 }
32
33 $catalog = CatalogIblockTable::getRow([
34 'select' => [
35 'IBLOCK_ID',
36 ],
37 'filter' => [
38 '=IBLOCK_ID' => $iblockId,
39 ],
40 'cache' => [
41 'ttl' => 86400,
42 ],
43 ]);
44
45 if ($catalog === null)
46 {
47 return true;
48 }
49
50 return AccessController::getCurrent()->check(ActionDictionary::ACTION_CATALOG_READ);
51 }
52}
Определения loader.php:13
static includeModule($moduleName)
Определения loader.php:67
$iblockId
Определения iblock_catalog_edit.php:30
$catalog
Определения iblock_catalog_edit.php:135