Method SetMailAccountOrganizationAsync
- Namespace
- MailFathom.Application.Access.Organizations
- Assembly
- MailFathom.Application.dll
SetMailAccountOrganizationAsync(Guid, Guid?, bool, CancellationToken)
Moves a mail account into an organization or out of every organization.
Task<OrganizationWriteResult> SetMailAccountOrganizationAsync(Guid mailAccountId, Guid? organizationId, bool underANarrowerGrant, CancellationToken cancellationToken)
Parameters
mailAccountIdGuidThe mail account being moved.
organizationIdGuid?The organization to move it into, or null to leave it in none.
underANarrowerGrantboolWhether the move is made under a grant held below the deployment, which may not move the effective settings of an account naming a secret that was not provisioned for one of its users.
cancellationTokenCancellationTokenCancels the write.
Returns
- Task<OrganizationWriteResult>
Written, UnknownMailAccount, UnknownOrganization, AssignmentsOutsideOrganization carrying how many of its users stand outside the target, SharedOnlyInOrganization carrying how many users an account leaving every organization is assigned to, or RecordLeftInvalid carrying what refuses the account under the settings policy of the target.
Remarks
Nothing is unassigned on the administrator's behalf: an account assigned to a user the target would not admit stays where it is, and so does an account assigned to more than one user that was asked to leave every organization, because an account in none is one person's. A move changes which settings policy governs the account, so the same commit writes the queryable settings it resolves to under the target's policy and moves the record version of every user it is assigned to; and nothing is rewritten on the account itself to make a move pass.