CheckForbiddenStrings: Boolean;
The CheckForbiddenStrings property determines whether a password is checked for occurrence of forbidden strings.
If the property is set to True, when the password is changed, a new password is checked for occurrence of forbidden strings specified in the ForbiddenStrings list.
To execute the example, add links to the Metabase and Collections system assemblies.
Sub UserProc;
Var
MB: IMetabase;
MS: IMetabaseSecurity;
MU: IMetabasePolicy;
PassPol: IMetabasePasswordPolicy;
Zapret: IStringList;
Lic: Object;
Begin
MB := MetabaseClass.Active;
// Check out license to work with security manager
Lic := MB.RequestLicense(UiLicenseFeatureType.Adm);
MS := MB.Security;
MU := MS.Policy;
PassPol := MU.PasswordPolicy;
Zapret := PassPol.ForbiddenStrings;
// Check password for occurrence of forbidden strings
PassPol.CheckForbiddenStrings := True;
// Clear the list and add forbidden words
Zapret.Clear;
Zapret.Add("abc");
Zapret.Add("123");
Zapret.Add("admin");
// Save changes
MS.Apply;
// Check in license
Lic := Null;
End Sub UserProc;
After executing the example the password is checked for occurrence of forbidden strings, and three forbidden values are added to the list.
See also: