IABACAttributeInstance.Attribute

Syntax

Attribute: IABACAttribute;

Description

The Attribute property returns attribute properties for editing.

Comments

This property is relevant on editing existing attribute properties.

To determine attribute properties, use the IABACAttribute interface.

Example

To execute the example, make sure that a custom attribute is added for users.

Add links to the ABAC, Metabase, and Dal system assemblies.

Sub UserProc;
Var
    Insts: IABACAttributeInstances;
    Attr: IABACAttribute;
    MB: IMetabase;
    MS: IMetabaseSecurity;
    Lic: Object;
    i, Count: Integer;
Begin
    MB := MetabaseClass.Active;
    // Get license to be able to work with the security manager
    Lic := MB.RequestLicense(UiLicenseFeatureType.Adm);
    MS := MB.Security;
    // Change identifier of the last user attribute
    Insts := MS.Users.Item(0).Attributes;
    Count := Insts.Count;
    Attr := Insts.Item(Count-1).Attribute;
    Attr.Id := "WORKDAYS";
    // Display properties of custom  user attributes in the console
    For i := 0 To Count-1 Do
        If Insts.Item(i).Attribute.Predefined = False Then
            Debug.WriteLine("Name: " + Insts.Item(i).Name(MB.CurrentLocale)); // name
            Debug.WriteLine("Identifier: " + Insts.Item(i).Id); // identifier
            Debug.WriteLine("Key: " + Insts.Item(i).Key.ToString); // key
            Debug.WriteLine("Data type: " + Insts.Item(i).DataType.ToString); // data type
            Debug.WriteLine("============================");
        End If;
    End For;
    // Save changes in security manager
    MB.Security.Apply;
    // Check in license
    Lic := Null;
End Sub UserProc;

After executing the example the last attribute identifier is changed. The properties of custom attributes for users are displayed in the console:

Name: Custom attribute

Identifier: CUSTOM_ATTR

Key: 15

Data type: 1

============================

Name: Number of workdays

Identifier: WORKDAYS

Key: 16

Data type: 2

============================

See also:

IABACAttributeInstance