CannotChangePassword: Boolean;
CannotChangePassword: System.Boolean;
The CannotChangePassword property determines whether the change of password is prohibited.
The property is set to False by default, and the user can change his own password. If the value is True, the exception condition will be generated when the password is tried to change.
To execute the example, add links to the Metabase, ForeSystem (for the Fore.NET example) system assemblies.
Sub UserProc;
Var
MB: IMetabase;
User: IMetabaseUser;
Users: IMetabaseUsers;
MS: IMetabaseSecurity;
Lic: Object;
Begin
MB := MetabaseClass.Active;
// Check out license to work with security manager
Lic := MB.RequestLicense(UiLicenseFeatureType.Adm);
MS := MB.Security;
Users := MS.Users;
User := Users.Item(0);
// Deny the user to change password
User.CannotChangePassword := 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;
Users: IMetabaseUsers;
MS: IMetabaseSecurity;
Lic: Object;
Begin
MB := Params.Metabase;
// Check out license to work with security manager
Lic := MB.RequestLicense(UiLicenseFeatureType.lftAdm);
MS := MB.Security;
Users := MS.Users;
User := Users.Item[0];
// Deny the user to change password
User.CannotChangePassword := True;
// Save changes
MS.Apply();
// Check in license
Lic := Null;
End Sub;
After executing the example the password change prohibition is set for the first user.
See also: