IRoleService UpdateUserRoles Method (String,  String ,  String ) CelloSaaS API Documentation
This method is used to update user roles. New role Identifier for user then insert role to user. Previous user role is not available in the current list then remove role from user.

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

void UpdateUserRoles(
	string userIdentifier,
	string[] updateRoleIdentifiers,
	string[] deleteRoleIdentifiers
)

Parameters

userIdentifier
Type: System String
User Identifier(Mandatory)
updateRoleIdentifiers
Type:  System String 
Update Role Identifiers(Mandatory)
deleteRoleIdentifiers
Type:  System String 
Delete Role Identifiers(Mandatory)
Exceptions

ExceptionCondition
System UnauthorizedAccessExceptionIf the use has not the privilege
CelloSaaS.ServiceContracts.AccessControlManagement RoleExceptionIf db exception occur
System ArgumentNullExceptionIf user id is null or empty
Examples

public void UpdateUserRoles()
{
    string userIdentifier = "3398F837-B988-4708-999D-D3DFE11875B3";
    string[] updateRoleIdentifiers = new string[] {"GR$Tenant_Admin"};
    string[] deleteRoleIdentifiers = new string[] {"GR$Product_Admin"};
    IRoleService roleService = ServiceLocator.Resolve>IRoleService<();
    roleService.UpdateUserRoles(userIdentifier, updateRoleIdentifiers,deleteRoleIdentifiers);
}
See Also