Table of Contents

Method AssignAsync

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

AssignAsync(Guid, AssignmentPrincipal, AssignmentScope, CancellationToken)

Gives a role to a user or a group at a scope, under an identifier this deployment mints.

public Task<GrantWriteResult> AssignAsync(Guid roleId, AssignmentPrincipal principal, AssignmentScope scope, CancellationToken cancellationToken)

Parameters

roleId Guid

The role.

principal AssignmentPrincipal

Who it is given to.

scope AssignmentScope

What it reaches.

cancellationToken CancellationToken

Cancels the write.

Returns

Task<GrantWriteResult>

What the act did, carrying the minted identifier when it was written; the outcome naming an unknown group, user, or organization also for one outside the caller's scope.

Exceptions

ArgumentNullException

Thrown when principal or scope is null.

PrincipalNotAuthorizedException

Thrown when the caller holds AdminRolesWrite at no scope, not over the deployment for an assignment at the deployment scope or of a role listing a pattern, or does not hold a name the role grants at a scope covering the assignment's.