• Модуль: calendar
  • Путь к файлу: ~/bitrix/modules/calendar/classes/general/calendar_sect.php
  • Класс: CCalendarSect
  • Вызов: CCalendarSect::getSectionAccess
static function getSectionAccess($sectionIdList, $sections)
{
	if (empty($sectionIdList))
	{
		return [];
	}

	$accessQuery = BitrixCalendarInternalsAccessTable::query()
		->setSelect([
			'ACCESS_CODE',
			'TASK_ID',
			'SECT_ID'
		])
		->whereIn('SECT_ID', $sectionIdList)
		->exec()
	;

	while ($access = $accessQuery->fetch())
	{
		if (!isset($sections[$access['SECT_ID']]['ACCESS']))
		{
			$sections[$access['SECT_ID']]['ACCESS'] = [];
		}

		$sections[$access['SECT_ID']]['ACCESS'][$access['ACCESS_CODE']] = (int)$access['TASK_ID'];
	}

	return $sections;
}