PolicySets: IABACPolicySets;
The PolicySets property is used to work with the policies sets collection.
To execute the example, make sure that attribute-based access control contains a policies set with a nested policies set.
To execute the example, add links to the ABAC and Metabase system assemblies.
Sub UserProc;
Var
PolicyObject: IABACRootPolicyObject;
PolicySet, EditSet: IABACPolicySet;
MB: IMetabase;
MS: IMetabaseSecurity;
Lic: Object;
Begin
MB := MetabaseClass.Active;
// Get license to be able to work with the security manager
Lic := MB.RequestLicense(UiLicenseFeatureType.Adm);
MS := MB.Security;
PolicyObject := MB.Security.Policy.ABACRules;
// Change description of the first policies set in the set
PolicySet := PolicyObject.Policies.Item(0); // the first policies set in attribute-based access control structure
EditSet := PolicySet.PolicySets.Item(0); // the first policies set in the selected set
EditSet.Description(MB.CurrentLocale) := "Test policies set";
// Disable activity of policies set in attribute-based access control structure
EditSet.Active := False;
// Display key of changed policies set in the console
Debug.WriteLine("Policies set key: " + EditSet.Key.ToString);
// Apply changes in security manager
MS.Apply;
// Check in license
Lic := Null;
End Sub UserProc;
After executing the example the nested policies set description is changed in attribute-based access control, and the checkbox that determines policies set activity is deselected in attribute-based access control structure:
The console displays the key of the nested policies set:
Policies set key: 123
See also: