IABACAttribute.Attributes

Syntax

Attributes: IABACAttributes;

Description

The Attributes property returns attributes collection.

Comments

To work with the attributes collection, use the IABACAttributes interface.

Example

To execute the example, place the Button component named Button1, and two Memo components named Memo1 and Memo2, respectively, on the form. Set the ScrollBars property to Vertical for Memo1.

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

The example is a handler of the OnClick event for the Button1 component.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    MB: IMetabase;
    MS: IMetabasePolicy;
    AttrObj: IMetabaseSecurityObjectsAttributes;
    ABACAttributes: IABACAttributes;
    ABACAttribute: IABACAttribute;
Begin
    MB := MetabaseClass.Active;
    MS := MB.Security.Policy;
    // Get object attributes
    AttrObj := MS.ObjectsAttributes;
    ABACAttributes := AttrObj.Global;
    // Display properties of each attribute
    For Each ABACAttribute In ABACAttributes Do
        Memo1.Lines.Add("Key: " + ABACAttribute.Key.ToString);
        Memo1.Lines.Add("Identifier: " + ABACAttribute.Id);
        Memo1.Lines.Add("Name: " + ABACAttribute.Name(MB.CurrentLocale));
        Memo1.Lines.Add("Description: " + ABACAttribute.Description(MB.CurrentLocale));
        Memo1.Lines.Add("Data type: " + ABACAttribute.DataType.ToString);
        Memo1.Lines.Add("Default value: " + ABACAttribute.DefaultValue);
        Memo1.Lines.Add("=========================================");
        Memo2.Lines.Add("Total in collection: " + ABACAttribute.Attributes.Count.ToString + " attributes");
    End For;
End Sub Button1OnClick;

After clicking the button the properties of system and custom object attributes are displayed:

See also:

IABACAttribute