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
namestringThe name an operator reads it by.
permissionsRolePermissionsWhat it grants.
cancellationTokenCancellationTokenCancels the write.
Returns
- Task<GrantWriteResult>
What the act did, carrying the minted identifier when it was written.
Exceptions
- ArgumentException
Thrown when
namebreaks FindNameRefusal(string?).- ArgumentNullException
Thrown when
permissionsis null.- PrincipalNotAuthorizedException
Thrown when the caller does not hold AdminRolesWrite over the deployment.