Struct MailFathomPermission
- Namespace
- MailFathom.Domain.Access
- Assembly
- MailFathom.Domain.dll
One named capability MailFathom publishes, which a grant lists and a caller either holds or does not.
[JsonConverter(typeof(MailFathomPermissionJsonConverter))]
[SuppressMessage("Naming", "CA1711:Identifiers should not have incorrect suffix", Justification = "The suffix is reserved for code access security, which .NET removed; permission is the word ADR 0012 fixed for this unit and the word an operator writes in configuration.")]
public readonly record struct MailFathomPermission : IEquatable<MailFathomPermission>
- Implements
- Inherited Members
Remarks
The type is a closed enumeration of values rather than a C# enum, because the name is the identity and it travels outside this process: an operator writes it in configuration, a deployment advertises it in its protected resource metadata document, and an authorization server mints it as a scope so a token can carry it. A member's ordinal would mean nothing to any of the three, and its C# name has to be free to change without moving what an operator already wrote.
The set is closed so that every name a grant can carry corresponds to a check that exists. A name nothing publishes is unknown rather than new, which is what lets startup refuse a misspelling instead of accepting a grant nobody enforces. Adding a member is a configuration-schema change and is made when the capability it names exists, never ahead of it.
A name is mailfathom.<domain>[.<subject>].<verb>, lowercase and dot-separated, and is
always a valid OAuth scope token so the same string can travel in a scope claim. The domain after
mailfathom. names what the permission governs — mail, the contact book, the task list, the calendar,
the notification centre, a person's own profile, the assistant, or the deployment's administration — and it is
admin exactly when the permission belongs to Administration. The two halves
are disjoint: no permission implies another, and holding one says nothing about holding the next.
Being a struct, default is reachable and is not a permission. It reports itself through IsSpecified, refuses to answer for a name, and is rejected by the JSON converter below; a grant is composed from TryParse(string?, out MailFathomPermission) or from the members themselves, so no undeclared value can reach one.
Properties
- AdminAuditRead
Gets the permission covering the per-account records derived from mail: the audits, the rules history, and the spam classifications.
- AdminConfigurationWrite
Gets the permission covering changing the deployment's own persisted configuration.
- AdminCredentialsWrite
Gets the permission covering storing a mailbox refresh token.
- AdminCustodyWrite
Gets the permission covering switching one mail account between mirroring its source server and holding its own mailbox.
- AdminErase
Gets the permission covering disposing of what this deployment holds: the mail stored for a folder an account no longer mirrors, one person and what the contact book derived from them, and a user together with every message, folder, attachment, and derived index held for them.
- AdminExport
Gets the permission covering carrying a whole mailbox out of this deployment: measuring an export, starting one, following it, downloading its archive, and deleting it.
- AdminOperate
Gets the permission covering asking the deployment to do work it can already do.
- AdminRead
Gets the permission covering the administrative reads that report the deployment's own state and no mail.
- AdminRolesWrite
Gets the permission covering roles, groups, and role assignments: defining a role, keeping a group and its members, and assigning or revoking a role at a scope.
- AdminSpend
Gets the permission covering the one operation that starts a provider bill, which is activating the declared embedding model.
- All
Gets every published permission.
- AssistantUse
Gets the permission covering placing something with a chat provider on the caller's behalf, and spending the allowance that is charged to.
- CalendarRead
Gets the permission covering reading a person's own calendar: a window of it, or one event.
- CalendarWrite
Gets the permission covering putting an event on a person's own calendar, amending one, accepting a date their mail proposed, removing one, and importing a calendar file.
- ContactsRead
Gets the permission covering the tools that read the contact book.
- ContactsWrite
Gets the permission covering the tools that record, amend, and erase a contact.
- IsDeploymentScopeOnly
Gets whether every operation this permission covers is the deployment's alone, so holding it at a narrower scope reaches nothing.
- IsSpecified
Gets whether this value names a published permission rather than the unusable struct default.
- MailAccountsWrite
Gets the permission covering a user maintaining their own record and the folders read out of the mail accounts assigned to them.
- MailDelete
Gets the permission covering deleting mail this deployment holds from the mail server itself.
- MailDraftsWrite
Gets the permission covering writing, editing, and giving up a draft this deployment holds.
- MailFlagsWrite
Gets the permission covering the tool that writes
\Seen,\Flagged, and keywords onto mail this deployment holds.
- MailFoldersWrite
Gets the permission covering creating, renaming, moving, and deleting the folders of a mailbox MailFathom holds.
- MailMove
Gets the permission covering moving mail this deployment holds from one of its folders into another.
- MailRead
Gets the permission covering reading the local mailbox copy, and nothing that writes.
- MailSend
Gets the permission covering asking this deployment to send mail from an account it holds.
- Name
Gets the published name, which is what an operator writes and what a token carries as a scope.
- NotificationsRead
Gets the permission covering reading a person's own notification centre and how much of it is unread.
- NotificationsWrite
Gets the permission covering marking a person's own notifications read and taking them out of the centre.
- ProfileRead
Gets the permission covering reading what a person set about themselves: their display name, their client preferences, their time zone, and their portrait.
- ProfileWrite
Gets the permission covering changing what a person set about themselves: their display name, their client preferences, their time zone, and their portrait.
- Surface
Gets the surface this permission belongs to.
- TasksRead
Gets the permission covering reading a person's own task list and what their mail proposed as a task.
- TasksWrite
Gets the permission covering recording, editing, completing, accepting, and erasing a task on a person's own list.
Methods
- PublishedFor(ProtectedSurface)
Reports every permission one surface publishes, which is what a grant nobody narrowed reaches.
- ToString()
Returns the fully qualified type name of this instance.
- TryParse(string?, out MailFathomPermission)
Parses an operator-supplied or token-supplied permission name.