Add/update privileges to role
Namespace: CelloSaaS.BusinessEdition.ServiceProxies.AccessControlManagementAssembly: CelloSaaS.BusinessEdition (in CelloSaaS.BusinessEdition.dll) Version: 4.3.1.0 (4.3.1.0)
Syntax
Parameters
- tenantIdentifier
- Type: System String
Tenant Code(Mandatory)
- lstRolePrivilege
- Type: System.Collections.Generic List RolePrivilege
Exceptions
Exception | Condition |
---|---|
[!:CelloSaaS.ServiceContracts.AccessControlManagement.PrivilegeException] | If db exception occurs |
[!:ArgumentNullException] | If tenant id or role privileges is null or empty |
System UnauthorizedAccessException | If the user has not the privilege |
Examples
public void SavePrivilegesToRole() { string tenantIdentifier = "B590CD25-3093-DF11-8DEB-001EC9DAB123"; List<RolePrivilege> rolePrivileges = new List<RolePrivilege>(); RolePrivilege rolePrivilege1 = new RolePrivilege(); rolePrivilege1.RoleId = "GR$Tenant_Admin"; rolePrivilege1.DataScopeId = "8FB38A1C-FCBD-4F99-9DED-6EA4CC0B97A4"; rolePrivilege1.PrivilegeId = "Add_Role"; rolePrivileges.Add(rolePrivilege1); rolePrivilege1 = new RolePrivilege(); rolePrivilege1.RoleId = "GR$Tenant_Admin"; rolePrivilege1.PrivilegeId = "Edit_Role"; rolePrivileges.Add(rolePrivilege1); rolePrivilege1 = new RolePrivilege(); rolePrivilege1.RoleId = "GR$Tenant_Admin"; rolePrivilege1.DataScopeId = "8FB38A1C-FCBD-4F99-9DED-6EA4CC0B97A4"; rolePrivilege1.PrivilegeId = "View_Role"; rolePrivileges.Add(rolePrivilege1); PrivilegeProxy.SavePrivilegesToRole(tenantIdentifier, rolePrivileges); }
See Also