Add(Name: String): IStation;
Add(System.String): Prognoz.Platform.Interop.Metabase.IStation;
Name. Workstation name.
The Add method adds a workstation to the collection.
To execute the example, add the Metabase, ForeSystem (for Fore.NET example) system assemblies.
Sub UserProc;
Var
MB: IMetabase;
MS: IMetabaseSecurity;
User: IMetabaseUser;
DS: IDomainStations;
Lic: Object;
Begin
MB := MetabaseClass.Active;
// Check out license to work with security manager
Lic := MB.RequestLicense(UiLicenseFeatureType.Adm);
MS := MB.Security;
// Get parameters of the specified user
User := MS.ResolveName("USER") As IMetabaseUser;
DS := User.StationIPs;
// Add an IP address from which access will be allowed for user
DS.Add("10.0.0.111");
// 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;
DS: IDomainStations;
Lic: Object;
Begin
MB := Params.Metabase;
// Check out license to work with security manager
Lic := MB.RequestLicense(UiLicenseFeatureType.lftAdm);
MS := MB.Security;
// Get parameters of the specified user
User := MS.ResolveName("USER") As IMetabaseUser;
DS := User.StationIPs;
// Add an IP address from which access will be allowed for user
DS.Add("10.0.0.111");
// 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.0.111. By default the user is allowed to access the system from any working stations, IP and MAC addresses.
See also: