Method RecordOnceAsync
- Namespace
- MailFathom.Application.Access.DefaultAdministrator
- Assembly
- MailFathom.Application.dll
RecordOnceAsync(UserId, Guid, DateTimeOffset, CancellationToken)
Records the default administrator unless this deployment ever recorded one, and reports the administrator it holds.
Task<DefaultAdministratorRecord> RecordOnceAsync(UserId candidate, Guid assignmentId, DateTimeOffset recordedAt, CancellationToken cancellationToken)
Parameters
candidateUserIdThe identifier the administrator is recorded under where this call is the one that records it.
assignmentIdGuidThe identifier of the assignment giving it the seeded administrator role at the deployment scope.
recordedAtDateTimeOffsetWhen the record is written.
cancellationTokenCancellationTokenCancels the write.
Returns
- Task<DefaultAdministratorRecord>
What the deployment holds afterwards: the administrator, or none where it was recorded once and removed since.
Remarks
The user, its endpoint switches turned off, the assignment, and the record that all three were written commit together, so no start can leave a deployment holding the record without the user or the user without its grant.