Table of Contents

Method SetEnabledAsync

Namespace
MailFathom.Application.Access.Credentials
Assembly
MailFathom.Application.dll

SetEnabledAsync(UserId, Guid, bool, CancellationToken)

Turns one credential on or off while it keeps what it is presented as.

public Task<UserCredentialWriteOutcome> SetEnabledAsync(UserId user, Guid credentialId, bool enabled, CancellationToken cancellationToken)

Parameters

user UserId

The user the credential belongs to.

credentialId Guid

The credential being written.

enabled bool

Whether it should authenticate requests.

cancellationToken CancellationToken

Cancels the write.

Returns

Task<UserCredentialWriteOutcome>

What the act did, or why it did nothing.

Remarks

Disabling is the reversible half of revoking: the credential stops working immediately and its lookup stays claimed, so nothing else can be provisioned under the name somebody is still using.

Exceptions

ArgumentException

Thrown when user names nobody or credentialId is the empty identifier.

PrincipalNotAuthorizedException

Thrown when the caller holds AdminCredentialsWrite at no scope, does not hold a name the user holds widely enough, or is not the root while the user holds a role listing a pattern.