Method ReplaceRolePermissionsAsync
- Namespace
- MailFathom.Application.Access.Grants
- Assembly
- MailFathom.Application.dll
ReplaceRolePermissionsAsync(Guid, RolePermissions, CancellationToken)
Replaces the whole list of permissions a role grants, which reaches everybody it is assigned to at their next request.
public Task<GrantWriteResult> ReplaceRolePermissionsAsync(Guid roleId, RolePermissions permissions, CancellationToken cancellationToken)
Parameters
roleIdGuidThe role.
permissionsRolePermissionsWhat it is to grant from now on.
cancellationTokenCancellationTokenCancels the write.
Returns
- Task<GrantWriteResult>
What the act did, refused as LastRoot when it would drop the root from the last role giving it.
Remarks
The root may write any published name and any pattern, its own role included: that is the one place a grant reaches past what its writer held, and why the root is the deployment-wide name alone.
Exceptions
- ArgumentNullException
Thrown when
permissionsis null.- PrincipalNotAuthorizedException
Thrown when the caller does not hold AdminRolesWrite over the deployment.