Class SerializableAuthorizationResult
- Namespace
- Excalibur.Dispatch.Serialization
- Assembly
- Excalibur.Dispatch.Abstractions.dll
Serializable implementation of IAuthorizationResult for AOT compatibility.
public sealed class SerializableAuthorizationResult : IAuthorizationResult
- Inheritance
-
SerializableAuthorizationResult
- Implements
- Inherited Members
- Extension Methods
Properties
FailureMessage
Gets the failure message when authorization is denied.
public string? FailureMessage { get; init; }
Property Value
Remarks
Contains a human-readable description of why authorization failed. Should be null when IsAuthorized is true. In production environments, consider limiting the detail in failure messages to prevent information disclosure that could aid attackers.
IsAuthorized
Gets a value indicating whether the authorization check passed.
public bool IsAuthorized { get; init; }
Property Value
Remarks
When true, the current security context has permission to process the message and processing can continue. When false, the message should be rejected and the FailureMessage should provide details about the denial.
Methods
Authorized()
Creates an authorized result.
public static SerializableAuthorizationResult Authorized()
Returns
Unauthorized(string)
Creates an unauthorized result.
public static SerializableAuthorizationResult Unauthorized(string reason)
Parameters
reasonstringThe reason for the authorization failure.