Certificate: String;
Certificate: System.String;
The Certificate property assigns valid certificate to user used to login.
To execute the example, place the Button and EditBox components (in the Fore.NET example use the TextBox component) named Button1, EditBox1/TextBox1.
Add links to the system assemblies:
For the Fore example: Metabase, Forms.
For Fore.NET example: Metabase, Forms.Net, ForeSystem.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
MB: IMetabase;
Value: String;
User: IMetabaseUser;
Security: IMetabaseSecurity;
Lic: Object;
Begin
MB := MetabaseClass.Active;
// Get license to work with security manager
Lic := MB.RequestLicense(UiLicenseFeatureType.Adm);
Security := MB.Security;
User := Security.ResolveName("ADMIN") As IMetabaseUser;
Value := EditBox1.Text;
User.Certificate := Value;
// Save changes
Security.Apply;
// Check in license
Lic := Null;
End Sub Button1OnClick;
Imports Prognoz.Platform.Forms.Net;
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.ForeSystem;
…
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
Value: String;
User: IMetabaseUser;
Security: IMetabaseSecurity;
Lic: Object;
Begin
MB := Self.Metabase;
// Get license to work with security manager
Lic := MB.RequestLicense(UiLicenseFeatureType.lftAdm);
Security := MB.Security;
User := Security.ResolveName("ADMIN") As IMetabaseUser;
Value := TextBox1.Text;
User.Certificate := Value;
// Save changes
Security.Apply();
// Check in license
Lic := Null;
End Sub;
After executing the example, clicking the button assigns the ADMIN user the certificate entered by the administrator in the EditBox1/TextBox1 component.
See also: