Assign role to many users.
Namespace: CelloSaaS.ServiceContracts.AccessControlManagementAssembly: CelloSaaS.ServiceContracts (in CelloSaaS.ServiceContracts.dll) Version: 4.3.1.0 (4.3.1.0)
Syntax
Parameters
- userIdentifiers
- Type: System String
User Identifiers(Mandatory)
- roleIdentifier
- Type: System String
Role Identifier(Mandatory)
Exceptions
Exception | Condition |
---|---|
System ArgumentException | |
CelloSaaS.ServiceContracts.AccessControlManagement RoleException | If db exception occur |
System ArgumentNullException | If the role id or user ids is null or empty. |
System UnauthorizedAccessException | If 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