• Модуль: socialnetwork
  • Путь к файлу: ~/bitrix/modules/socialnetwork/lib/componenthelper.php
  • Класс: BitrixSocialnetworkComponentHelper
  • Вызов: ComponentHelper::getAllowToAllDestination
static function getAllowToAllDestination($userId = 0)
{
	global $USER;

	$userId = (int)$userId;
	if ($userId <= 0)
	{
		$userId = (int)$USER->getId();
	}

	$allowToAll = (Option::get("socialnetwork", "allow_livefeed_toall", "Y") === "Y");

	if ($allowToAll)
	{
		$toAllRightsList = unserialize(Option::get("socialnetwork", "livefeed_toall_rights", 'a:1:{i:0;s:2:"AU";}'), [ 'allowed_classes' => false ]);
		if (!$toAllRightsList)
		{
			$toAllRightsList = array("AU");
		}

		$userGroupCodeList = array_merge(array("AU"), CAccess::getUserCodesArray($userId));
		if (count(array_intersect($toAllRightsList, $userGroupCodeList)) <= 0)
		{
			$allowToAll = false;
		}
	}

	return $allowToAll;
}