IMetabaseUser.Certificate

Syntax

Certificate: String;

Certificate: System.String;

Description

The Certificate property assigns certificate copy to the user,under whom the login is executed.

Comments

A certificate copy can be obtained using the IMetabaseUser.InitCertificate method.

Example

To execute the example, place the Button and EditBox components (for Fore.NET example use the TextBox component) named Button1, EditBox1/TextBox1.

Add links to the system assemblies:

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:

IMetabaseUser