IRoleService AddRole Method (String, String, String) CelloSaaS API Documentation
Adds a new role to the system.

Namespace: CelloSaaS.ServiceContracts.AccessControlManagement
Assembly: CelloSaaS.ServiceContracts (in CelloSaaS.ServiceContracts.dll) Version: 4.3.1.0 (4.3.1.0)
Syntax

string AddRole(
	string tenantCode,
	string roleName,
	string description
)

Parameters

tenantCode
Type: System String
Tenant Code
roleName
Type: System String
Role Name(Mandatory)
description
Type: System String
Role Description

Return Value

Type: String
Inserted Role Id
Exceptions

ExceptionCondition
System.Data DataExceptionIf the role name is duplicate
CelloSaaS.ServiceContracts.AccessControlManagement RoleExceptionIf pre or post processor was not inserted.
System ArgumentNullExceptionIf role name or description is null or empty.
System ArgumentExceptionIf role details is null
Examples

public void AddRole()
{
string tenantCode = "B590CD25-3093-DF11-8DEB-001EC9DAB123";
string roleName = "Tenant_Admin";
string description = "Tenant Admin Role";
IRoleService roleService = ServiceLocator.Resolve>IRoleService<();
string roleId = roleService.AddRole(tenantCode, roleName, description);
}
See Also