• Модуль: im
  • Путь к файлу: ~/bitrix/modules/im/lib/V2/Entity/User/UserBot.php
  • Класс: BitrixImV2EntityUserUserBot
  • Вызов: UserBot::checkAccessWithoutCaching
protected function checkAccessWithoutCaching(User $otherUser): bool
{
	if (!static::$moduleManager::isModuleInstalled('intranet'))
	{
		return $this->hasAccessBySocialNetwork($otherUser->getId());
	}

	global $USER;
	if ($otherUser->isExtranet())
	{
		if ($otherUser->getId() === $USER->GetID())
		{
			if ($USER->IsAdmin())
			{
				return true;
			}

			if (static::$loader::includeModule('bitrix24'))
			{
				if (CBitrix24::IsPortalAdmin($otherUser->getId()) || BitrixBitrix24Integrator::isIntegrator($otherUser->getId()))
				{
					return true;
				}
			}
		}

		$inGroup = BitrixImIntegrationSocialnetworkExtranet::isUserInGroup($this->getId(), $otherUser->getId());
		if ($inGroup)
		{
			return true;
		}


		return false;
	}

	if ($this->isNetwork())
	{
		return true;
	}

	return true;
}