13use Bitrix\Catalog\Access\Install\AccessInstaller\InstallStatus;
54 return static::getInstance(
$userId);
68 if (!ModuleManager::isModuleInstalled(
'crm') || InstallStatus::inProgress())
70 return $this->checkLegacy(
$action);
75 && State::isExternalCatalog()
105 $ruleObject = $this->ruleFactory->createFromAction(
$action, $this);
106 if (! $ruleObject instanceof
BaseRule)
116 : $ruleObject->getPermissionValue(
$params)
125 private function checkLegacy(
string $action): bool
133 $legacyAction =
null;
134 if (array_key_exists(
$action, $legacyActions))
140 foreach ($legacyActions as $oldAction => $newActions)
142 if (in_array(
$action, $newActions,
true))
144 $legacyAction = $oldAction;
156 return $this->user->isAdmin() || (Loader::includeModule(
"bitrix24") && \CBitrix24::isPortalAdmin($this->user->getUserId()));
179 if (empty($allowStoresIds))
183 $allowStoresIds = array_map(
'intval', $allowStoresIds);
188 $allStoresId = PermissionDictionary::VALUE_VARIATION_ALL;
190 in_array($defaultStoreId, $allowStoresIds,
true)
191 || in_array($allStoresId, $allowStoresIds,
true)
194 return $defaultStoreId;
198 return reset($allowStoresIds);
205 public function hasIblockAccess(
string $action): bool
208 $rule = $this->iblockRuleFactory->createFromAction(
$action, $this);
214 return $rule->execute();
227 if ($permissionValue ===
null)
232 if (is_array($permissionValue))
234 return in_array(PermissionDictionary::VALUE_VARIATION_ALL, $permissionValue,
true);
237 return $this->
check($action);
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
getPermissionValue(string $action)
loadItem(int $itemId=null)
checkByValue(string $action, string $value)
IblockRuleFactory $iblockRuleFactory
getAllowedDefaultStoreId()
checkCompleteRight(string $action)
check(string $action, AccessibleItem $item=null, $params=null)
const ACTION_CATALOG_READ
getPermissionMultiValues($params)
static getDefaultStoreId()
static createFromId(int $userId)
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']