Files
lmxopcua/docs/ui-consistency/ot13-root-fields/device-forms/canary/CommonFixtureServices.cs
T
2026-11-13 21:52:00 -05:00

15 lines
820 B
C#

using System.Reflection;
using System.Security.Claims;
using Microsoft.AspNetCore.Components.Authorization;
/// <summary>Authenticated read-only fixture identity; no real authorization store.</summary>
public sealed class CommonFixturePrincipal : AuthenticationStateProvider
{
public override Task<AuthenticationState> GetAuthenticationStateAsync() => Task.FromResult(new AuthenticationState(
new ClaimsPrincipal(new ClaimsIdentity([new(ClaimTypes.Name,"fixture-reader"),new(ClaimTypes.Role,"Reader")],"fixture"))));
}
/// <summary>Every external browse/connection operation is refused.</summary>
public class CommonRefusingBrowser : DispatchProxy
{
protected override object? Invoke(MethodInfo? method,object?[]? args) => throw new NotSupportedException("Common field fixture refuses "+method?.Name);
}