Files
AdPlatform-Server/Management/Security/ClientContext.cs
2026-02-03 15:04:37 -08:00

21 lines
686 B
C#

namespace Management.Security;
/// <summary>
/// Request-scoped authentication context.
/// Populated by ClientAuthMiddleware.
/// </summary>
public sealed class ClientContext
{
public string? SessionId { get; set; }
public string? ClientId { get; set; }
public string? PlatformClientId { get; set; }
public string? ClientName { get; set; }
public string? UserId { get; set; }
public string? Email { get; set; }
public string? Role { get; set; }
public bool IsDevBypass { get; set; }
public bool IsAuthenticated => !string.IsNullOrWhiteSpace(ClientId);
public bool IsAdmin => string.Equals(Role, "Admin", StringComparison.OrdinalIgnoreCase);
}