Table of Contents

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

message MessageContext

The message (sender, conversation, services).

role string

The role name.

cancellationToken CancellationToken

Cancels the check.

Returns

ValueTask<bool>

true to grant the role; false if this provider doesn't grant it.