IMetabaseUser.LockedState

Syntax

LockedState: MetabaseUserLockedState;

Description

The LockedState property determines a state of user lock.

Comments

If the LockedForever state is set, there will be no possibility to unlock the user. The user who has the Creating and Deleting Users privilege can lock another user. The ADMIN user has this privilege by default.

Example

To execute the example, make sure that security manager contains the USER user.

Add a link to the Metabase system assembly.

Sub UserProc;
Var
    MB: IMetabase;
    MS: IMetabaseSecurity;
    User: IMetabaseUser;
    Lic: Object;
Begin
    MB := MetabaseClass.Active;
    
// Check out 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.LockedState := MetabaseUserLockedState.LockedForever;
    
// Save changes
    MS.Apply;
    
// Check in license
    Lic := Null;
End Sub UserProc;

After executing the example the USER user will be locked forever.

See also:

IMetabaseUser