Adds a new role to the system.
Namespace: CelloSaaS.ServiceContracts.AccessControlManagementAssembly: CelloSaaS.ServiceContracts (in CelloSaaS.ServiceContracts.dll) Version: 4.3.1.0 (4.3.1.0)
Syntax
Parameters
- roleDetails
- Type: CelloSaaS.Model.AccessControlManagement Role
Role Details(Mandatory - Role Name)
Return Value
Type: StringInserted Role Id
Exceptions
Exception | Condition |
---|---|
System.Data DataException | If the role name is duplicate |
CelloSaaS.ServiceContracts.AccessControlManagement RoleException | If pre or post processor was not inserted. |
System ArgumentNullException | If role name or description is null or empty. |
System ArgumentException | If role details is null |
Examples
public void AddRole() { Role roleDetails = new Role(); roleDetails.TenantId = "B590CD25-3093-DF11-8DEB-001EC9DAB123"; roleDetails.RoleName = "Tenant_Admin"; roleDetails.Description = "Tenant Admin Role"; IRoleService roleService = ServiceLocator.Resolve>IRoleService<(); string roleId = roleService.AddRole(roleDetails); }
See Also