StationIPs: IDomainStations;
StationIPs: Prognoz.Platform.Interop.Metabase.IDomainStations;
The StationIPs property returns the collection of the IP-addresses of the PCs, from which the user access is granted.
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;
MS: IMetabaseSecurity;
User: IMetabaseUser;
Lic: Object;
Begin
MB := MetabaseClass.Active;
// Get license to work with security manager
Lic := MB.RequestLicense(UiLicenseFeatureType.Adm);
MS := MB.Security;
// Set allowed IP address
User := MS.ResolveName("USER") As IMetabaseUser;
User.StationIPs.Add("10.0.2.158");
// 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;
MS: IMetabaseSecurity;
User: IMetabaseUser;
Lic: Object;
Begin
MB := Params.Metabase;
// Get license to work with security manager
Lic := MB.RequestLicense(UiLicenseFeatureType.lftAdm);
MS := MB.Security;
// Set allowed IP address
User := MS.ResolveName("USER") As IMetabaseUser;
User.StationIPs.Add("10.0.2.158");
// Save changes
MS.Apply();
// Check in license
Lic := Null;
End Sub;
After executing the example the access fro the USER user will be allowed only from IP address 10.0.2.158. By default the user is allowed to access the system from any working stations, IP and MAC addresses.
See also: