• Модуль: catalog
  • Путь к файлу: ~/bitrix/modules/catalog/lib/Access/AccessController.php
  • Класс: BitrixCatalogAccessAccessController
  • Вызов: AccessController::getAllowedDefaultStoreId
public function getAllowedDefaultStoreId(): ?int
{
	$allowStoresIds = $this->getPermissionValue(ActionDictionary::ACTION_STORE_VIEW) ?? [];
	if (empty($allowStoresIds))
	{
		return null;
	}
	$allowStoresIds = array_map('intval', $allowStoresIds);

	$defaultStoreId = StoreTable::getDefaultStoreId();
	if ($defaultStoreId)
	{
		$allStoresId = PermissionDictionary::VALUE_VARIATION_ALL;
		if (
			in_array($defaultStoreId, $allowStoresIds, true)
			|| in_array($allStoresId, $allowStoresIds, true)
		)
		{
			return $defaultStoreId;
		}
	}

	return reset($allowStoresIds);
}