• Модуль: im
  • Путь к файлу: ~/bitrix/modules/im/lib/settings.php
  • Класс: BitrixImSettings
  • Вызов: Settings::isBetaAvailable
static function isBetaAvailable(): bool
{
	$userId = Common::getUserId();
	if (!$userId)
	{
		return false;
	}

	if (
		BitrixMainLoader::includeModule('bitrix24')
		&& CBitrix24::IsNfrLicense()
	)
	{
		return true;
	}

	$result = BitrixMainConfigOption::get('im', 'beta_access', 'N');
	if ($result === 'N')
	{
		return false;
	}

	if ($result === 'Y')
	{
		return true;
	}

	try
	{
		$users = Json::decode($result);
		if (in_array($userId, $users, true))
		{
			return true;
		}
	}
	catch (ArgumentException $exception)
	{
		return false;
	}

	return false;
}