Interface IRoleProvider
- Namespace
- Signal.Application.Roles
- Assembly
- Signal.Application.dll
Decides whether a message's sender has a role. Several providers can be registered (e.g. configuration plus a
database); a role is granted if any of them grants it. Register with AddRoleProvider<T>(); providers are
resolved from the message scope, so they may use scoped services.
public interface IRoleProvider
Methods
HasRoleAsync(MessageContext, string, CancellationToken)
Whether the sender of message has role in its conversation.
ValueTask<bool> HasRoleAsync(MessageContext message, string role, CancellationToken cancellationToken)
Parameters
messageMessageContextThe message (sender, conversation, services).
rolestringThe role name.
cancellationTokenCancellationTokenCancels the check.