StationsPolicy: IStations;
StationsPolicy: Prognoz.Platform.Interop.Metabase.IStations;
The StationsPolicy property returns list of stations that enter current repository was prohibited.
To execute the example, add links to the Metabase, ForeSystem (for the Fore.NET example) system assemblies.
Sub UserProc;
Var
MB: IMetabase;
MS: IMetabaseSecurity;
Policy: IMetabasePolicy;
Lic: Object;
Stat: IStations;
St: IStation;
Begin
MB := MetabaseClass.Active;
// Check out license to work with security manager
Lic := MB.RequestLicense(UiLicenseFeatureType.Adm);
MS := MB.Security;
Policy := MS.Policy;
// Add a new workstation to the list of stations
Stat := Policy.StationsPolicy;
Stat.Refresh;
St := Stat.FindByName("TEST_PC");
St.Access := StationAccessType.Forbidden;
St.Included := True;
// 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;
Policy: IMetabasePolicy;
Lic: Object;
Stat: IStations;
St: IStation;
Begin
MB := Params.Metabase;
// Check out license to work with security manager
Lic := MB.RequestLicense(UiLicenseFeatureType.lftAdm);
MS := MB.Security;
Policy := MS.Policy;
// Add a new workstation to the list of stations
Stat := Policy.StationsPolicy;
Stat.Refresh();
St := Stat.FindByName("TEST_PC");
St.Access := StationAccessType.Forbidden;
St.Included := True;
// Save changes
MS.Apply();
// Check in license
Lic := Null;
End Sub;
After executing this example the TEST_PC workstation is added to a list of stations that enter current repository was prohibited.
See also: