• Модуль: voximplant
  • Путь к файлу: ~/bitrix/modules/voximplant/lib/security/rolemanager.php
  • Класс: BitrixVoximplantSecurityRoleManager
  • Вызов: RoleManager::loadRoleAccess
static function loadRoleAccess()
{
	if(is_array(static::$accessCodeToRole))
	{
		return;
	}

	if(Helper::canUse())
	{
		$cursor = RoleAccessTable::getList([
			'cache' => [
				'ttl' => static::$cacheTtl
			]
		]);
		while($row = $cursor->fetch())
		{
			static::$accessCodeToRole[$row['ACCESS_CODE']] ??= [];

			static::$accessCodeToRole[$row['ACCESS_CODE']][] = $row['ROLE_ID'];
		}
	}
	else
	{
		foreach (Helper::getDefaultRoleAccess() as $row)
		{
			static::$accessCodeToRole[$row['ACCESS_CODE']][] = $row['ROLE'];
		}
	}
}