Table of Contents

Method CreateRoleAsync

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

CreateRoleAsync(string?, RolePermissions, CancellationToken)

Records a role under an identifier this deployment mints.

public Task<GrantWriteResult> CreateRoleAsync(string? name, RolePermissions permissions, CancellationToken cancellationToken)

Parameters

name string

The name an operator reads it by.

permissions RolePermissions

What it grants.

cancellationToken CancellationToken

Cancels the write.

Returns

Task<GrantWriteResult>

What the act did, carrying the minted identifier when it was written.

Exceptions

ArgumentException

Thrown when name breaks FindNameRefusal(string?).

ArgumentNullException

Thrown when permissions is null.

PrincipalNotAuthorizedException

Thrown when the caller does not hold AdminRolesWrite over the deployment.