Table of Contents

Class OwnPortrait

Namespace
MailFathom.Application.Portraits
Assembly
MailFathom.Application.dll

Reads, replaces, and removes the picture the signed-in person is drawn by.

public sealed class OwnPortrait
Inheritance
OwnPortrait
Inherited Members

Remarks

Whose portrait this is comes from the principal rather than from the request, exactly as it does for the user record and for a person's preferences: there is no argument here for another user's identifier, so a request about somebody else is something a caller cannot express rather than something a surface has to refuse.

Reading is admitted under ProfileRead and the two writes under ProfileWrite. The writes are deliberately not MailAccountsWrite: that grant decides what this deployment reads out of somebody's mailboxes, somebody whose mail configuration an administrator maintains in full does not hold it, and what a person is drawn by must not be decided by a grant over their mail configuration.

The picture is a stored file the user record links to. A replacement writes the new file, then links it, then removes the file it displaced, so a failure between any two steps leaves at most a file nothing links to, which UnlinkedStoredFileSweep removes — never a record linking to a file that is gone.

A read answers nothing where there is no portrait, rather than refusing: a client draws the initials it already has from the person's name, so an absent picture is an ordinary state of the screen rather than an error on it. Octets that are no image kind this build stores are answered the same way, because a file nothing here could have written is a file this surface has nothing to say about.

Constructors

OwnPortrait(AccessAuthorization, IStoredFileStore, IUserRecordFileLinks)

Initializes the use case.

Methods

ReadAsync(CancellationToken)

Reads the picture the signed-in person is drawn by.

RemoveAsync(CancellationToken)

Removes the picture the signed-in person is drawn by.

ReplaceAsync(UserPortrait, CancellationToken)

Replaces the picture the signed-in person is drawn by.