[]]; } try { $authorizationService = $container->get(AuthorizationService::class); $actorContext = ['actor_user_id' => $userId]; $canViewChecks = $authorizationService->authorize(SecurityAuthorizationPolicy::ABILITY_CHECKS_VIEW, $actorContext)->isAllowed(); $canManageTemplates = $authorizationService->authorize(SecurityAuthorizationPolicy::ABILITY_TEMPLATES_MANAGE, $actorContext)->isAllowed(); $canManageSettings = $authorizationService->authorize(SecurityAuthorizationPolicy::ABILITY_SETTINGS_MANAGE, $actorContext)->isAllowed(); } catch (\Throwable) { $canViewChecks = false; $canManageTemplates = false; $canManageSettings = false; } return ['security.nav' => [ 'can_view_checks' => $canViewChecks, 'can_manage_templates' => $canManageTemplates, 'can_manage_settings' => $canManageSettings, ]]; } }