Interface IUserRecordPolicyJudge
- Namespace
- MailFathom.Infrastructure.Persistence.Policies
- Assembly
- MailFathom.Infrastructure.dll
Judges a user's record against the policies a write would leave it governed by.
public interface IUserRecordPolicyJudge
Remarks
Two writes change which policies govern a record without writing the record: a write of a policy, and a move of the user into or out of an organization. Each has to answer two things about every record it reaches before it commits — whether the record is still one this deployment can serve, and which endpoints its user is served on — and both answers come from resolving the record and binding it, which is the composition root's to do because the record's own type and its rules live there. So the stores that own those two transactions ask through this port, inside the transaction and under the lock that keeps the policies still.
An implementation reads nothing and performs no I/O: everything it judges is handed to it, which is what lets it be called for every governed record of a write without lengthening the transaction by a round trip each.
Methods
- Judge(IReadOnlyList<GovernedUserRecord>)
Judges the records one write reaches, each under the policies the write would leave it governed by.