• Модуль: socialnetwork
  • Путь к файлу: ~/bitrix/modules/socialnetwork/classes/general/rest.php
  • Класс: CSocNetLogRestService
  • Вызов: CSocNetLogRestService::getGroupFeatureAccess
static function getGroupFeatureAccess($arFields)
{
	$arSocNetFeaturesSettings = CSocNetAllowed::GetAllowedFeatures();

	$groupID = (int) ($arFields["GROUP_ID"] ?? null);
	$feature = trim((string) ($arFields["FEATURE"] ?? ''));
	$operation = trim((string) ($arFields["OPERATION"] ?? ''));

	if ($groupID <= 0)
	{
		throw new ArgumentException("Wrong socialnetwork group ID");
	}

	if (
		$feature === ''
		|| !array_key_exists($feature, $arSocNetFeaturesSettings)
		|| !array_key_exists("allowed", $arSocNetFeaturesSettings[$feature])
		|| !in_array(SONET_ENTITY_GROUP, $arSocNetFeaturesSettings[$feature]["allowed"], true)
	)
	{
		throw new ArgumentException("Wrong feature");
	}

	if (
		$operation === ''
		|| !array_key_exists("operations", $arSocNetFeaturesSettings[$feature])
		|| !array_key_exists($operation, $arSocNetFeaturesSettings[$feature]["operations"])
	)
	{
		throw new ArgumentException("Wrong operation");
	}

	return CSocNetFeaturesPerms::CurrentUserCanPerformOperation(SONET_ENTITY_GROUP, $groupID, $feature, $operation);
}