From 11de14d12e83e993df5a8a7b88f56710cfdeed10 Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Wed, 3 Jun 2026 03:18:08 -0400 Subject: [PATCH] refactor(adminui): explicit ClaimTypes.Role footer filter; fix stale NavSidebar comment --- .../Components/Layout/MainLayout.razor | 4 ++-- src/Server/ZB.MOM.WW.OtOpcUa.Host/Program.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Layout/MainLayout.razor b/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Layout/MainLayout.razor index 71136240..43c12ab3 100644 --- a/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Layout/MainLayout.razor +++ b/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Layout/MainLayout.razor @@ -1,5 +1,5 @@ @inherits LayoutComponentBase -@using Microsoft.AspNetCore.Components.Routing +@using System.Security.Claims @* Thin delegation to the shared ZB.MOM.WW.Theme side-rail chassis. ThemeShell owns the brand bar, the CSS-only narrow-viewport hamburger, and the responsive collapse, @@ -38,7 +38,7 @@ @context.User.Identity?.Name
@string.Join(", ", context.User.Claims - .Where(c => c.Type.EndsWith("/role")).Select(c => c.Value)) + .Where(c => c.Type == ClaimTypes.Role).Select(c => c.Value))
diff --git a/src/Server/ZB.MOM.WW.OtOpcUa.Host/Program.cs b/src/Server/ZB.MOM.WW.OtOpcUa.Host/Program.cs index 740e0c88..c44c5171 100644 --- a/src/Server/ZB.MOM.WW.OtOpcUa.Host/Program.cs +++ b/src/Server/ZB.MOM.WW.OtOpcUa.Host/Program.cs @@ -147,7 +147,7 @@ if (hasAdmin) // registered". Idempotent on fused admin,driver nodes (TryAddEnumerable de-dups). builder.Services.AddOtOpcUaDriverProbes(); // Flow AuthenticationState through cascading parameters so works - // inside interactive components (NavSidebar's session block). + // in the static MainLayout footer and other components (e.g. Account.razor, Routes.razor). builder.Services.AddCascadingAuthenticationState(); builder.Services.AddSignalR(); builder.Services.AddOtOpcUaAdminClients();