IRoleService AddUsersToRole Method ( String , String) CelloSaaS API Documentation
Assign role to many users.

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

void AddUsersToRole(
	string[] userIdentifiers,
	string roleIdentifier
)

Parameters

userIdentifiers
Type:  System String 
User Identifiers(Mandatory)
roleIdentifier
Type: System String
Role Identifier(Mandatory)
Exceptions

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

public void AddUsersToRole()
{
    string[] userIdentifiers = new string[] {"C051E882-E393-DF11-8DEB-001EC9DAB123", "C151E882-E393-DF11-8DEB-001EC9DAB123"};
    string roleIdentifier = "GR$Tenant_Admin";
    IRoleService roleService = ServiceLocator.Resolve>IRoleService<();
    roleService.AddUsersToRole(userIdentifiers, roleIdentifier);
}
See Also