• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/integration/socialnetwork/group.php
  • Класс: BitrixTasksIntegrationSocialNetworkGroup
  • Вызов: Group::getIdsByAllowedAction
static function getIdsByAllowedAction($actionCode = self::ACTION_VIEW_ALL_TASKS, $ownGroups = true, $userId = 0)
{
	if (!static::includeModule())
	{
		return [];
	}

	$cacheKey = $actionCode.'-'.$userId;

	if(array_key_exists($cacheKey, static::$cache))
	{
		return static::$cache[$cacheKey];
	}

	$groups = BitrixSocialnetworkItemWorkgroup::getByFeatureOperation([
		'feature' 	=> 'tasks',
		'operation' => $actionCode,
		'userId' 	=> $userId
	]);

	$groups = array_column($groups, 'ID');

	static::$cache[$cacheKey] = $groups;

	return static::$cache[$cacheKey];
}