Table of Contents

Method RequirePermissionOverAsync

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

RequirePermissionOverAsync(MailFathomPermission, MailAccountId, CancellationToken)

Requires that an admitted caller holding one named capability over one mail account is what reached this use case.

public Task RequirePermissionOverAsync(MailFathomPermission permission, MailAccountId account, CancellationToken cancellationToken)

Parameters

permission MailFathomPermission

The capability the operation is published under.

account MailAccountId

The account the operation names.

cancellationToken CancellationToken

Cancels placing the account.

Returns

Task

A task that completes once the caller is admitted.

Remarks

A caller holding the permission over the whole deployment is admitted without the account being placed, so an operator's grant costs no read and reaches an account the deployment no longer holds exactly as it did before a grant had a scope.

Exceptions

ArgumentException

Thrown when permission names no published capability.

PrincipalNotAuthorizedException

Thrown when the work was reached under no principal, under a principal that is not a caller, or by a caller holding the permission at no scope covering the account.

RequirePermissionOverAsync(MailFathomPermission, UserId, CancellationToken)

Requires that an admitted caller holding one named capability over one user is what reached this use case.

public Task RequirePermissionOverAsync(MailFathomPermission permission, UserId user, CancellationToken cancellationToken)

Parameters

permission MailFathomPermission

The capability the operation is published under.

user UserId

The user the operation names.

cancellationToken CancellationToken

Cancels placing the user.

Returns

Task

A task that completes once the caller is admitted.

Exceptions

ArgumentException

Thrown when permission names no published capability.

PrincipalNotAuthorizedException

Thrown when the work was reached under no principal, under a principal that is not a caller, or by a caller holding the permission at no scope covering the user.