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
- tenantCode
- Type: System String
Tenant Code
- roleName
- Type: System String
Role Name(Mandatory)
- description
- Type: System String
Role Description
- roleQualifierQuery
- Type: System String
Qualifier Query (Obsolete)
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() { string tenantCode = "B590CD25-3093-DF11-8DEB-001EC9DAB123"; string roleName = "Tenant_Admin"; string description = "Tenant Admin Role"; string roleQualifierQuery = string.Empty; IRoleService roleService = ServiceLocator.Resolve>IRoleService<(); string roleId = roleService.AddRole(tenantCode, roleName, description, roleQualifierQuery); }
See Also