IMetabasePasswordPolicy.CheckPassword

Syntax

CheckPassword(User: IMetabaseUser; NewPassword: String; OldPassword: String);

Parameters

User. User, for whom the correctness of a new password should be checked.

NewPassword. Password to be checked.

OldPassword. Old password that is used for comparison during check.

Description

The CheckPassword method validates user new password for consistency according to the specified passwords policy in the security manager. If password does not correspond to the specified passwords policy, an exception is thrown.

Example

To execute the example, add a link to the Metabase system assembly.

Sub UserProc;
Var
    Mb: IMetabase;
    Sec: IMetabaseSecurity;
    User: IMetabaseUser;
Begin
    Mb := MetabaseClass.Active;
    Sec := Mb.Security;
    User := Sec.Users.Item(
0);
    Sec.Policy.PasswordPolicy.CheckPassword(User, 
"qwe""qwr");
End Sub UserProc;

After executing the example if a restriction for a minimum difference of an old password from a new one for more than one character is set in passwords policy, an exception is thrown.

See also:

IMetabasePasswordPolicy