Table of Contents

Struct UserId

Namespace
MailFathom.Domain.Access
Assembly
MailFathom.Domain.dll

Identifies the person a unit of work is acting for.

public readonly record struct UserId : IEquatable<UserId>
Implements
Inherited Members

Remarks

A user is somebody a deployment serves, and their mail is one of the things they own rather than what makes them a user at all: a calendar, tasks, contacts, preferences, reminders, notifications, and what a discovery run was started by all hang on this value, and so does the erasure that removes every one of them. The identity is generated rather than chosen, so it names nobody outside this deployment and carries nothing about the person — a display name, an address, and every other personal detail belong to the user's own record rather than to the value every row of theirs points at.

It lives beside the permission vocabulary because it is the second axis an access decision is taken on, and the two are asked together: a permission says what a caller may do and this says whose it may be done to. It is deliberately not part of the permission set — no permission names a user, and holding one says nothing about who is being acted for.

Being a struct, default is reachable and is not a user. It reports itself through IsSpecified so a value that names nobody cannot be mistaken for one that does, and Create(Guid) refuses the empty identifier outright.

Properties

IsSpecified

Gets whether this value names a user at all.

Value

Gets the generated user identity, or the empty identifier when this value names nobody.

Methods

Create(Guid)

Creates a user identity from a persisted identifier.

ToString()

Returns the fully qualified type name of this instance.