IMetabasePasswordPolicy.NotAllowUserName

Syntax

NotAllowUserName: Boolean;

NotAllowUserName: System.Boolean;

Description

The NotAllowUserName property determines a restriction on coincidence of user's name and password.

Comments

If the property is set to True, on password changing it is checked for matching the user name. If they match, the error is generated.

By default the property is set to False, and the match check is not performed.

Example

To execute the example, add links to the Metabase, ForeSystem (for the Fore.NET example) system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    MS: IMetabaseSecurity;
    PswPolicy: IMetabasePasswordPolicy;
    Lic: Object;
Begin
    MB := MetabaseClass.Active;
    
// Get license to work with security manager
    Lic := MB.RequestLicense(UiLicenseFeatureType.Adm);
    MS := MB.Security;
    PswPolicy := MS.Policy.PasswordPolicy;
    
// Disallow user name and password to match
    PswPolicy.NotAllowUserName := 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;
    MS: IMetabaseSecurity;
    PswPolicy: IMetabasePasswordPolicy;
    Lic: Object;
Begin
    MB := Params.Metabase;
    
// Get license to work with security manager
    Lic := MB.RequestLicense(UiLicenseFeatureType.lftAdm);
    MS := MB.Security;
    PswPolicy := MS.Policy.PasswordPolicy;
    
// Disallow user name and password to match
    PswPolicy.NotAllowUserName := True;
    
// Save changes
    MS.Apply();
    
// Check in license
    Lic := Null;
End Sub;

After executing the example, it will be disallowed to match user name and password.

See also:

IMetabasePasswordPolicy