IsLocked: Boolean;
IsLocked: System.Boolean;
The IsLocked property determines locking of the account of the specified user.
To execute the example, make sure that security manager contains the USER user.
Add links to the Metabase, ForeSystem (for the Fore.NET example) system assemblies.
Sub UserProc;
Var
MB: IMetabase;
User: IMetabaseUser;
MS: IMetabaseSecurity;
Lic: Object;
Begin
MB := MetabaseClass.Active;
// Get license to work with security manager
Lic := MB.RequestLicense(UiLicenseFeatureType.Adm);
MS := MB.Security;
// Lock the USER user
User := MS.ResolveName("USER") As IMetabaseUser;
User.IsLocked := True;
// Save changes
MS.Apply;
// Check in license
Lic := Null;
End Sub UserProc;
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.ForeSystem;
…
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
User: IMetabaseUser;
MS: IMetabaseSecurity;
Lic: Object;
Begin
MB := Params.Metabase;
// Get license to work with security manager
Lic := MB.RequestLicense(UiLicenseFeatureType.lftAdm);
MS := MB.Security;
// Lock user
User := MS.ResolveName("USER") As IMetabaseUser;
User.IsLocked := True;
// Save changes
MS.Apply();
// Check in license
Lic := Null;
End Sub;
After executing the example the USER user is locked.
See also: