Add project files.
This commit is contained in:
20
Management/Security/ClientContext.cs
Normal file
20
Management/Security/ClientContext.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
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);
|
||||
}
|
||||
Reference in New Issue
Block a user