Class QueryHealthAuthorization
- Namespace
- Cratis.Arc.Queries
- Assembly
- Cratis.Arc.Core.dll
Applies the configured query health access requirements at pipeline authorization boundaries.
public class QueryHealthAuthorization : IAnonymousEvaluator, IAuthorizationAttributeEvaluator
- Inheritance
-
QueryHealthAuthorization
- Implements
- Inherited Members
- Extension Methods
Constructors
QueryHealthAuthorization(IOptions<ArcOptions>)
Initializes a new instance of the QueryHealthAuthorization class without a host environment.
public QueryHealthAuthorization(IOptions<ArcOptions> options)
Parameters
optionsIOptions<ArcOptions>The configured Arc options.
QueryHealthAuthorization(IOptions<ArcOptions>, IHostEnvironment?)
Applies the configured query health access requirements at pipeline authorization boundaries.
public QueryHealthAuthorization(IOptions<ArcOptions> options, IHostEnvironment? environment)
Parameters
optionsIOptions<ArcOptions>The configured Arc options.
environmentIHostEnvironmentThe host environment.
Methods
GetAuthorizationInfo(MethodInfo)
Checks if the method has an authorization attribute and retrieves role information.
public (bool HasAuthorize, string? Roles)? GetAuthorizationInfo(MethodInfo method)
Parameters
methodMethodInfoThe method to check.
Returns
- (bool HasAuthorize, string Roles)?
Tuple with (hasAuthorize, roles) or null if this evaluator cannot determine.
GetAuthorizationInfo(Type)
Checks if the type has an authorization attribute and retrieves role information.
public (bool HasAuthorize, string? Roles)? GetAuthorizationInfo(Type type)
Parameters
typeTypeThe type to check.
Returns
- (bool HasAuthorize, string Roles)?
Tuple with (hasAuthorize, roles) or null if this evaluator cannot determine.
IsAnonymousAllowed(MethodInfo)
Checks if anonymous access is allowed for the specified method.
public bool? IsAnonymousAllowed(MethodInfo method)
Parameters
methodMethodInfoThe method to check.
Returns
- bool?
True if anonymous access is allowed, false otherwise, or null if this evaluator cannot determine.
IsAnonymousAllowed(Type)
Checks if anonymous access is allowed for the specified type.
public bool? IsAnonymousAllowed(Type type)
Parameters
typeTypeThe type to check.
Returns
- bool?
True if anonymous access is allowed, false otherwise, or null if this evaluator cannot determine.