IABACPolicy.Key

Syntax

Key: Integer;

Description

The Key property returns policy key.

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;
    Policy: IABACPolicy;
    MB: IMetabase;
    MS: IMetabaseSecurity;
Begin
    MB := MetabaseClass.Active;
    MS := MB.Security;
    // Get attribute-based access control
    PolicyObject := MB.Security.Policy.ABACRules;
    // Display properties of the first policy in the policies set
    PolicySet := PolicyObject.Policies.Item(0);
    Policy := PolicySet.Policies.Item(0);
    Debug.WriteLine(Policy.Name(MB.CurrentLocale)); // name
    Debug.WriteLine(Policy.Key); // key
    Debug.WriteLine(Policy.Id); // identifier
End Sub UserProc;

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

Test policy

10

TEST_POLICY

See also:

IABACPolicy