Table of Contents

Method ReadRolesHeldByAsync

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

ReadRolesHeldByAsync(UserId, CancellationToken)

Reads which roles one user holds, at which scopes, through the same assignments ReadGrantOfAsync(UserId, CancellationToken) reads.

Task<IReadOnlyList<HeldRole>> ReadRolesHeldByAsync(UserId user, CancellationToken cancellationToken)

Parameters

user UserId

The user.

cancellationToken CancellationToken

Cancels the read.

Returns

Task<IReadOnlyList<HeldRole>>

Each role at each scope once, ordered by role name and then by scope; empty for a user assigned nothing, and for nobody at all.

Remarks

It answers who a user is to the deployment, which is what a person reads; what they may do is the grant, and the two are never derived from each other.

Exceptions

ArgumentException

Thrown when user names nobody.