Interface IActorProvider
- Namespace
- Trellis.Authorization
- Assembly
- Trellis.Authorization.dll
Provides the current authenticated actor for authorization behaviors. Implement in the API/ACL layer, typically extracting from HttpContext.User or resolving permissions from a database. Register as scoped in DI.
public interface IActorProvider
- Extension Methods
Methods
GetCurrentActorAsync(CancellationToken)
Returns the current actor. Throws if no authenticated user exists (authentication should be handled before the request reaches the mediator pipeline).
Task<Actor> GetCurrentActorAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenToken to cancel the asynchronous operation.