MaxLogonSessions: Integer;
The MaxLogonSessions property determines the maximum number of concurrent repository logins for the security subject.
Security subjects are users and groups of users. The property sets constraint for all security subjects and is relevant when the user is not created in the security subject but is in a group, for example, when domain authentication is used.
To determine the maximum number of concurrent logins of specified user, use the IMetabaseUser.MaxLogonSessions property.
Features of interaction of the IMetabasePolicy.MaxLogonSessions property with the IMetabaseUser.MaxLogonSessions property:
If one of the properties is set to 0, and the other is greater than 0, the greater value is applied.
If property values are greater than 0 and differ from each other, the less value is applied.
The property is set to 0 by default, which means the number of logins is unlimited. If the number of allowed repository logins is exceeded, the security subject is denied login to the system and the corresponding message is displayed.
To execute the example, add a link to the Metabase system assembly.
Sub UserProc;
Var
MB: IMetabase;
MS: IMetabaseSecurity;
Policy: IMetabasePolicy;
Lic: Object;
Begin
MB := MetabaseClass.Active;
// Get license to be able to work with the security manager
Lic := MB.RequestLicense(UiLicenseFeatureType.Adm);
MS := MB.Security;
// Get security policy settings
Policy := MS.Policy;
// Set maximum number of sessions for security subject
Policy.MaxLogonSessions := 5;
// Save changes
MS.Apply;
// Check in license
Lic := Null;
End Sub UserProc;
After executing the example, the maximum number of concurrent repository logins is set for the security subject.
See also: