Value: Variant;
Value: System.Object;
The Value property determines an attribute value.
This property is relevant when the custom attribute value is edited.
To determine default attribute value, use the IABACAttribute.DefaultValue property.
To execute the example, make sure that an integer custom attribute with the WORKDAYS identifier is added for users.
Add links to the ABAC, Metabase, ForeSystem (for the Fore.NET example) system assemblies.
Sub UserProc;
Var
Insts: IABACAttributeInstances;
Inst: IABACAttributeInstance;
MB: IMetabase;
MS: IMetabaseSecurity;
User: IMetabaseUser;
Lic: Object;
Begin
MB := MetabaseClass.Active;
// Get license to work with security manager
Lic := MB.RequestLicense(UiLicenseFeatureType.Adm);
MS := MB.Security;
// Get first user attributes
User := MS.Users.Item(0);
Insts := User.Attributes;
// Find attribute with the WORKDAYS identifier
Inst := Insts.FindById("WORKDAYS");
// Check if found attribute has multiple values
If Inst.IsArray = False Then
// Change attribute value if it is not multiple
Inst.Value := 20;
End If;
// Save changes in security manager
MS.Apply;
// Check in license
Lic := Null;
End Sub UserProc;
Imports Prognoz.Platform.Interop.ABAC;
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.ForeSystem;
…
Public Shared Sub Main(Params: StartParams);
Var
Insts: IABACAttributeInstances;
Inst: IABACAttributeInstance;
MB: IMetabase;
MS: IMetabaseSecurity;
User: IMetabaseUser;
Lic: Object;
Begin
MB := Params.Metabase;
// Get license to work with security manager
Lic := MB.RequestLicense(UiLicenseFeatureType.lftAdm);
MS := MB.Security;
// Get first user attributes
User := MS.Users.Item[0];
Insts := User.Attributes;
// Find attribute with the WORKDAYS identifier
Inst := Insts.FindById("WORKDAYS");
// Check if found attribute has multiple values
If Inst.IsArray = False Then
// Change attribute value if it is not multiple
Inst.Value := 20;
End If;
// Save changes in security manager
MS.Apply();
// Check in license
Lic := Null;
End Sub;
After executing the example the attribute value with the WORKDAYS identifier is changed for the specified user.
See also: