@page "/role-grants" @* Per Q4 of the AdminUI rebuild plan, v2 replaced v1's per-cluster RoleGrants table with a fleet-wide LDAP-group → role map. This page surfaces the mapping read-only; the source of truth is Authentication:Ldap:GroupToRole in appsettings (editable on the host filesystem, not from the UI yet). *@ @attribute [Microsoft.AspNetCore.Authorization.Authorize] @rendermode RenderMode.InteractiveServer @using Microsoft.Extensions.Options @using ZB.MOM.WW.OtOpcUa.Security.Ldap @inject IOptionsSnapshot Ldap

Role grants

LDAP group membership determines fleet roles. Edit the mapping in appsettings.json under Authentication:Ldap:GroupToRole and restart the admin node (or sign out + back in for cached claims to refresh). UI-driven editing of the mapping is deferred — it implies a config-reload mechanism that doesn't exist yet.
@if (_options is null) {

Loading…

} else {
LDAP binding
Enabled@(_options.Enabled ? "yes" : "no")
Server@_options.Server:@_options.Port
UseTls@_options.UseTls
SearchBase@_options.SearchBase
@if (!_options.UseTls && _options.AllowInsecureLdap) {
WarningPlaintext credentials over LDAP — dev mode only
}
Group → role mapping (@(_options.GroupToRole?.Count ?? 0))
@if (_options.GroupToRole is null || _options.GroupToRole.Count == 0) {
No mapping configured. Every authenticated user lands with zero roles — the fallback authorization policy will refuse every request. Add a GroupToRole entry before deploying.
} else {
@foreach (var kvp in _options.GroupToRole.OrderBy(k => k.Key, StringComparer.OrdinalIgnoreCase)) { }
LDAP groupResolved role
@kvp.Key @kvp.Value
}
} @code { private LdapOptions? _options; protected override void OnInitialized() { _options = Ldap.Value; } }