IMetabaseUser.MaxLogonSessions

Syntax

MaxLogonSessions: Integer;

MaxLogonSessions: System.Int32;

Description

The MaxLogonSessions property determines the maximum count of concurrent repository connect sessions for the user.

Comments

In case the maximum allowed connection sessions number is exceeded the user is shown the corresponding message and gets the new connection terminated.

The property default value is "0", which means the connection sessions number is unlimited.

Example

To execute the example, make sure that security manager contains the USER user.

Add links to the Metabase, ForeSystem (for the Fore.NET example) system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    Security: IMetabaseSecurity;
    User: IMetabaseUser;
    Lic: Object;
Begin
    MB := MetabaseClass.Active;
    
// Get license to work with security manager
    Lic := MB.RequestLicense(UiLicenseFeatureType.Adm);
    Security := MB.Security;
    
// Set maximum number of simultaneous user connections to repository
    User := Security.ResolveName("USER"As IMetabaseUser;
    User.MaxLogonSessions := 
5;
    
// Save changes
    Security.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;
    Security: IMetabaseSecurity;
    User: IMetabaseUser;
    Lic: Object;
Begin
    MB := Params.Metabase;
    
// Get license to work with security manager
    Lic := MB.RequestLicense(UiLicenseFeatureType.lftAdm);
    Security := MB.Security;
    
// Set maximum number of simultaneous user connections to repository
    User := Security.ResolveName("USER"As IMetabaseUser;
    User.MaxLogonSessions := 5;
    
// Save changes
    Security.Apply();
    
// Check in license
    Lic := Null;
End Sub;

After executing the example, the maximum number of simultaneous connections to the current repository is set for the USER user.

See also:

IMetabaseUser