Table of Contents

Class UserGrantResolver

Namespace
MailFathom.Application.Access.Grants
Assembly
MailFathom.Application.dll

Computes what a user holds, from the roles assigned to them directly and through their groups.

public sealed class UserGrantResolver
Inheritance
UserGrantResolver
Inherited Members

Remarks

The one place a user's grant comes from. It is computed from the records rather than stored on the user, so a change to any of them reaches the next request rather than the next sign-in; what this replica computed is kept in UserGrantCache until an announced change or the convergence interval forgets it.

What a caller may do is this grant narrowed by whatever admitted it — the surface's half, the credential's list, and a token's scopes — through NarrowedTo(IEnumerable<MailFathomPermission>). None of those is asked here, because each is a fact about the request rather than about the user.

Constructors

UserGrantResolver(IGrantStore, UserGrantCache)

Initializes the resolver over where grants are kept and what this replica remembers of them.

Methods

ResolveAsync(UserId, CancellationToken)

Computes what one user holds.

WidensOnUpgradeAsync(UserId, CancellationToken)

Reports whether what one user holds widens on upgrade, because a role they were given lists a pattern.