Class AssignedMailAccountCatalog
- Namespace
- MailFathom.Application.Accounts
- Assembly
- MailFathom.Application.dll
Answers which of the accounts this deployment serves are assigned to the user the work in hand is acting for.
public sealed class AssignedMailAccountCatalog : ICallerMailAccountCatalog
- Inheritance
-
AssignedMailAccountCatalog
- Implements
- Inherited Members
Remarks
The user axis enters the mailbox here and nowhere else. Every caller-facing resolution reads this, so narrowing a read to one person is one decision taken once rather than a predicate each read model has to remember to carry, and a read model that reached the deployment's catalog instead names a member this port does not publish.
What decides the answer is the assignment relation rather than a user carried on the account. A mailbox is one mailbox however many people read it, so the account arrives with no user attached and the assignments say who reaches it; a caller is served exactly the accounts assigned to the user they were admitted for, and two callers assigned one account are served the same mailbox rather than a copy each.
The empty answer and the refusal are deliberately different outcomes. A user assigned nothing is answered with an empty set, which the resolution turns into a scope that reads nothing; a principal acting for no user is refused, because an empty answer there would let this process's own identity or the deployment administrator reach a caller-facing read and be told, in the shape of an answer, that they are assigned nothing.
Constructors
- AssignedMailAccountCatalog(IDeploymentMailAccountCatalog, IMailAccountAssignments, AccessAuthorization)
Initializes the caller-scoped catalog.
Properties
- SynchronizationEnabled
Gets whether this deployment refreshes the local copy of these accounts at all.
- User
Gets the user this unit of work is acting for, whose assignments decide what every read narrowed here returns.
Methods
- ReadAssignedAccountsAsync(CancellationToken)
Reads the accounts the user in hand is assigned, deduplicated and ordered, or empty when they are assigned none.