Method AddGroupMemberAsync
- Namespace
- MailFathom.Application.Access.Grants
- Assembly
- MailFathom.Application.dll
AddGroupMemberAsync(Guid, UserId, CancellationToken)
Makes a user a member of a group, which gives them every assignment the group holds.
public Task<GrantWriteResult> AddGroupMemberAsync(Guid groupId, UserId user, CancellationToken cancellationToken)
Parameters
groupIdGuidThe group.
userUserIdThe user joining it.
cancellationTokenCancellationTokenCancels the write.
Returns
- Task<GrantWriteResult>
What the act did, Unchanged for somebody who was already a member; UnknownGroup and UnknownUser also for a group or a user outside the caller's scope.
Exceptions
- ArgumentException
Thrown when
usernames nobody.- PrincipalNotAuthorizedException
Thrown when the caller holds AdminRolesWrite at no scope, does not hold a name the group's assignments give at a scope covering where they give it, or is not the root while one of those assignments gives a role listing a pattern.