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
roleIdGuidThe role.
principalAssignmentPrincipalWho it is given to.
scopeAssignmentScopeWhat it reaches.
cancellationTokenCancellationTokenCancels 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
principalorscopeis 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.