IABACRootPolicyObject.FindByGuidStr

Syntax

FindByGuidStr(GuidStr: String): IABACEvaluatedObject;

Description

The FindByGuidStr method searches for attribute-based access control structure element by unique identifier.

Example

To execute the example, make sure that attribute-based access control contains policies set with nested policy.

To execute the example, add links to the ABAC and Metabase system assemblies.

Sub UserProc;
Var
    PolicyObject: IABACRootPolicyObject;
    PolicySet: IABACPolicySet;
    Policies: IABACPolicies;
    Policy: IABACEvaluatedObject;
    Guid: IABACEvaluatedObject;
    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;
    // Get attribute-based access control
    PolicyObject := MB.Security.Policy.ABACRules;
    // Get policy with the 0 index in the first policies set
    PolicySet := PolicyObject.Policies.Item(0);
    Policies := PolicySet.Policies;
    Policy := Policies.Item(0);
    //Find element attribute-based access control attribute by unique identifier
    Guid := PolicyObject.FindByGuidStr(Policy.GuidStr);
    // Display name and unique identifier of policies set in the console
    Debug.WriteLine(Policy.Name(MB.CurrentLocale)); // name
    Debug.WriteLine(Policy.GuidStr); // unique identifier
    // Check in license
    Lic := Null;
End Sub UserProc;

After executing the example the console displays name and unique identifier of the specified policy, for example:

Test policies set

{8AFCD069-B6DC-4205-A76C-7FF28AD78199}

See also:

IABACRootPolicyObject