- Модуль: socialnetwork
- Путь к файлу: ~/bitrix/modules/socialnetwork/classes/general/user.php
- Класс: CAllSocNetUser
- Вызов: CAllSocNetUser::CanProfileView
static function CanProfileView($currentUserId, $arUser, $siteId = SITE_ID, $arContext = [])
{
global $USER;
if (
!is_array($arUser)
&& (int)$arUser > 0
)
{
$dbUser = CUser::getById((int)$arUser);
$arUser = $dbUser->fetch();
}
if (
!is_array($arUser)
|| !isset($arUser["ID"])
|| (int)$arUser["ID"] <= 0
)
{
return false;
}
if (
(int)$currentUserId === (int)$USER->GetId()
&& self::isCurrentUserModuleAdmin()
)
{
return true;
}
if (self::OnGetProfileView($currentUserId, $arUser, $siteId, $arContext)) // only for email users
{
return true;
}
if (self::isCalendarSharingUser($currentUserId, $arUser, $siteId, $arContext)) // only for calendar sharing users
{
return true;
}
$bFound = false;
foreach(GetModuleEvents("socialnetwork", "OnGetProfileView", true) as $arEvent)
{
if (ModuleManager::isModuleInstalled($arEvent['TO_MODULE_ID']))
{
$bFound = true;
if (ExecuteModuleEventEx($arEvent, [ $currentUserId, $arUser, $siteId, $arContext, false ]) === true)
{
return true;
}
}
}
return (!$bFound);
}