Method ReadGrantSourcesOfAsync
- Namespace
- MailFathom.Application.Access.Grants
- Assembly
- MailFathom.Application.dll
ReadGrantSourcesOfAsync(UserId, GrantListingReach, int, CancellationToken)
Reads why one user holds what they hold: one row per permission, entry of a role's list granting it, and assignment.
Task<IReadOnlyList<GrantSource>> ReadGrantSourcesOfAsync(UserId user, GrantListingReach reach, int limit, CancellationToken cancellationToken)
Parameters
userUserIdThe user.
reachGrantListingReachWhat the reader's own grant covers, which is what ReadAssignmentsAsync(AdministrativeListingQuery, GrantListingReach, CancellationToken) lists within.
limitintThe most rows to answer with.
cancellationTokenCancellationTokenCancels the read.
Returns
- Task<IReadOnlyList<GrantSource>>
The rows ReadGrantOfAsync(UserId, CancellationToken) computes its union from that lie within
reach, each naming the role, the pattern a name nobody wrote out is reached through, and the group it came through, ordered by assignment and then by stored entry; empty for a user assigned nothing there.
Remarks
A membership of a group in an organization the user has since left grants nothing, and is answered with no row,
exactly as ReadGrantOfAsync(UserId, CancellationToken) reads it. An assignment whose group or scope lies outside
reach is answered with no row either, because the reader could not list it.
Exceptions
- ArgumentException
Thrown when
usernames nobody.- ArgumentOutOfRangeException
Thrown when
limitis not positive.