• Модуль: imconnector
  • Путь к файлу: ~/bitrix/modules/imconnector/lib/connector.php
  • Класс: BitrixImConnectorConnector
  • Вызов: Connector::isAllowedConnectorInRegion
static function isAllowedConnectorInRegion(string $connectorId, string $region): bool
{
	$result = true;

	if (!empty($region) && !empty(Library::CONNECTOR_PER_REGION_LIMITATION[$connectorId]))
	{
		$allow = Library::CONNECTOR_PER_REGION_LIMITATION[$connectorId]['allow'] ?? null;
		$deny = Library::CONNECTOR_PER_REGION_LIMITATION[$connectorId]['deny'] ?? null;

		if (!empty($deny) && in_array($region, $deny))
		{
			$result = false;
		}
		elseif (!empty($allow) && !in_array($region, $allow))
		{
			$result = false;
		}
	}

	return $result;
}