• Модуль: voximplant
  • Путь к файлу: ~/bitrix/modules/voximplant/lib/security/helper.php
  • Класс: BitrixVoximplantSecurityHelper
  • Вызов: Helper::getDefaultRoleAccess
static function getDefaultRoleAccess(): array
{
	$result = [];

	$result[] = [
		'ROLE' => 'admin',
		'ACCESS_CODE' => 'G1'
	];

	if(BitrixMainLoader::includeModule('intranet'))
	{
		$departmentTree = CIntranetUtils::GetDeparmentsTree();
		$rootDepartment = (int)$departmentTree[0][0];

		if($rootDepartment > 0)
		{
			$result[] = [
				'ROLE' => 'manager',
				'ACCESS_CODE' => 'DR'.$rootDepartment
			];
		}
	}

	return $result;
}