Attributes: IABACAttributes;
The Attributes property returns the collection of attributes of user groups.
The property is read-only.
To execute the example, add links to the ABAC, Metabase, and Dal system assemblies.
Sub UserProc;
Var
Attr: IABACAttribute;
Attrs: IABACAttributes;
MB: IMetabase;
MS: IMetabaseSecurity;
Lic: Object;
Begin
MB := MetabaseClass.Active;
MS := MB.Security;
// Check out license to work with security manager
Lic := MB.RequestLicense(UiLicenseFeatureType.Adm);
// Add attribute for users
Attrs := MS.Users.Attributes;
Attr := Attrs.Add;
Attr.Name(MB.CurrentLocale) := "New attribute"; // attribute name
Attr.Id := "ATTR_USER"; // attribute identifier
Attr.DataType := DbDataType.String; // attribute data type
Attr.DefaultValue := "User name"; // default name
// Add an attribute for groups of users
Attrs := MS.Groups.Attributes;
Attr := Attrs.Add;
Attr.Name(MB.CurrentLocale) := "New attribute"; // attribute name
Attr.Id := "ATTR_GROUP"; // attribute identifier
Attr.DataType := DbDataType.Integer; // attribute data type
Attr.DefaultValue := 20; // default name
// Save changes in security manager
MS.Apply;
// Check in license
Lic := Null;
End Sub UserProc;
After executing the example, attributes with specified properties are added for users and user groups.
In the security manager the added attributes are contained in the Attributes window.
See also: