IRoleService AddRole Method (Role, 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(
	Role roleDetails,
	string roleQualifierQuery
)

Parameters

roleDetails
Type: CelloSaaS.Model.AccessControlManagement Role
Role Details(Mandatory - Role Name, Role Description)
roleQualifierQuery
Type: System String
Qualifier Query (Obsolete)

Return Value

Type: String
Inserted Role Identifier
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()
{  
   Role roleDetails = new Role();
   roleDetails.TenantId = "B590CD25-3093-DF11-8DEB-001EC9DAB123";
   roleDetails.RoleName = "Tenant_Admin";        
   roleDetails.Description = "Tenant Admin Role";
   string roleQualifierQuery = string.Empty;  
   IRoleService roleService = ServiceLocator.Resolve>IRoleService<();
   string roleId = roleService.AddRole(roleDetails, roleQualifierQuery);
}
See Also