Parent: Object;
The Parent property enables the user to get parent element for the specified element of the attribute-based access control structure.
The first level of elements hierarchy is used as the top parent element.
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 Main;
Var
PolicyObject: IABACRootPolicyObject;
PolicySet, PolicySet2: IABACPolicySet;
MB: IMetabase;
MS: IMetabaseSecurity;
Lic: Object;
Parent: Object;
s: string;
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;
// Get the first policies set in attribute-based access control structure
PolicySet := PolicyObject.Policies.Item(0);
// Get the first policies set in the selected set
PolicySet2 := PolicySet.PolicySets.Item(0);
//Set parent element for selected set
Parent := PolicySet2.Parent;
//Determine whether parent element is on the first hierarchy level
If Parent <> Null Then
s := s + "parent";
If Parent Is IABACRootPolicyObject Then
s := s + " is a root";
Else
s := s + " is not a root";
End If;
Else
s := s + "parent is empty";
End If;
Debug.WriteLine(s);
// Check in license
Lic := Null;
End Sub Main;
After executing the example the following message is displayed in the console:
parent is not a root
See also: