IABACAttribute.Predefined

Syntax

Predefined: Boolean;

Description

The Predefined property returns True if an attribute is system.

Comments

Attributes are divided into system and custom, they are used on creating an objective and additional conditions of access check.

NOTE. Properties of system attributes cannot be changed.

Example

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

Add links to the ABAC and Metabase system assemblies.

Sub UserProc;
Var
    ABACAttribute: IABACAttribute;
    ABACAttributes: IABACAttributes;
    MB: IMetabase;
    MS: IMetabaseSecurity;
    Str: String;
Begin
    MB := MetabaseClass.Active;
    MS := MB.Security;
    // Check attributes of users
    ABACAttributes := MS.Users.Attributes;
    ABACAttribute := ABACAttributes.Item(6);
    If ABACAttribute.Predefined = True Then
        Str:= "system";
        Else Str:= "custom";
    End If;
    Debug.WriteLine("Attribute " + "«" + ABACAttribute.Name(MB.CurrentLocale) + "»" + " - " + Str);
    ABACAttribute := ABACAttributes.Item(7);
    If ABACAttribute.Predefined = True Then
        Str:= "system";
        Else Str:= "custom";
    End If;
    Debug.WriteLine("Attribute " + "«" + ABACAttribute.Name(MB.CurrentLocale) + "»" + " - " + Str);
End Sub UserProc;

After executing the example the console displays:

The Administrator attribute - system

The ATTR16 attribute - custom

See also:

IABACAttribute