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
permissionMailFathomPermissionThe capability the operation is published under.
accountMailAccountIdThe account the operation names.
cancellationTokenCancellationTokenCancels 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
permissionnames 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
permissionMailFathomPermissionThe capability the operation is published under.
userUserIdThe user the operation names.
cancellationTokenCancellationTokenCancels placing the user.
Returns
- Task
A task that completes once the caller is admitted.
Exceptions
- ArgumentException
Thrown when
permissionnames 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.