Table of Contents

Interface IPolicyProvider<TPolicy>

Namespace
Excalibur.A3.Authorization
Assembly
Excalibur.A3.Abstractions.dll

Represents a provider that retrieves a policy of type TPolicy.

public interface IPolicyProvider<TPolicy> where TPolicy : IPolicy

Type Parameters

TPolicy

The type of the policy being provided. Must implement IPolicy.

Methods

GetPolicyAsync()

Asynchronously retrieves an instance of the policy for the current user or context.

Task<TPolicy> GetPolicyAsync()

Returns

Task<TPolicy>

A task that represents the asynchronous operation. The task result contains the policy of type TPolicy configured for the user or context.

Remarks

The method implementation should provide logic to determine the policy configuration based on the current user, context, or application state. The policy returned must be specific to the intended use case of the application.