AzureCosmosDbCreateRole Method

Creates a new role in the database for a company.

Definition

Namespace: MobileTrack.DataContainers.Cosmos
Assembly: MobileTrack.DataContainers (in MobileTrack.DataContainers.dll) Version: 0.8+34f1bbd8dc6b32752cfce829cbed66e15113d7ba
public Task<RoleDto> CreateRole(
	RoleDto newRole,
	UserSessionData createdBy,
	CancellationToken cancellationToken = default
)

Parameters

newRole  RoleDto
Role to be created.
createdBy  UserSessionData
User creating the role.
cancellationToken  CancellationToken  (Optional)
Cancellation token

Return Value

TaskRoleDto
Cosmos DB Object-creation Task

Implements

IAzureCosmosDbCreateRole(RoleDto, UserSessionData, CancellationToken)

Exceptions

UnauthorizedAccessExceptionThrown if the user createdBy did not have the correct permissions
ArgumentNullExceptionThrown if newRole or createdBy was
ResourceInvalidStateExceptionThrown if newRole is in an invalid state.

See Also