Key: Integer;
Key: System.UInt32;
The Key property returns policy key.
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, 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 structure
PolicyObject := MB.Security.Policy.ABACRules;
// Display properties of the first policy in policies set in the console
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;
Imports Prognoz.Platform.Interop.ABAC;
Imports Prognoz.Platform.Interop.Metabase;
…
Public Shared Sub Main(Params: StartParams);
Var
PolicyObject: IABACRootPolicyObject;
PolicySet: IABACPolicySet;
Policy: IABACPolicy;
MB: IMetabase;
MS: IMetabaseSecurity;
Begin
MB := Params.Metabase;
MS := MB.Security;
// Get attribute-based access control structure
PolicyObject := MB.Security.Policy.ABACRules;
// Display properties of the first policy in policies set in the console
PolicySet := PolicyObject.Policies.Item[0];
Policy := PolicySet.Policies.Item[0];
System.Diagnostics.Debug.WriteLine(Policy.Name[MB.CurrentLocale]); // name
System.Diagnostics.Debug.WriteLine(Policy.Key); // key
System.Diagnostics.Debug.WriteLine(Policy.Id); // identifier
End Sub;
After executing the example the console displays name, key, and identifier of the specified policy:
Test policy
10
TEST_POLICY
See also: