CreateExporter: IMetabaseSecurityExporter;
CreateExporter: Prognoz.Platform.Interop.Metabase.IMetabaseSecurityExporter;
The CreateExporter method creates an object to export settings of security policy and access permissions.
The user who has the privilege "Change security label and a list of access control of any object" can perform export of access permissions.
The user who has the privilege "Change user rights, give roles, change policy" can perform export of settings of security policy.
To execute the example, add links to the Metabase, ForeSystem (for the Fore.NET example) system assemblies.
Sub UserProc;
Var
MB: IMetabase;
Exporter: IMetabaseSecurityExporter;
Lic: Object;
Begin
MB := MetabaseClass.Active;
// Get license to work with security manager
Lic := MB.RequestLicense(UiLicenseFeatureType.Adm);
// Export settings of security policy and access permissions
Exporter := MB.Security.CreateExporter;
Exporter.FileName := "C:\MetabasePolicy.csv";
Exporter.ExportPolicy;
// 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;
Exporter: IMetabaseSecurityExporter;
Lic: Object;
Begin
MB := Params.Metabase;
// Get license to work with security manager
Lic := MB.RequestLicense(UiLicenseFeatureType.lftAdm);
// Export settings of security policy and access permissions
Exporter := MB.Security.CreateExporter();
Exporter.FileName := "C:\MetabasePolicy.csv";
Exporter.ExportPolicy();
// Check in license
Lic := Null;
End Sub;
After executing this example export of settings of security policy is performed in a specified file. If the file already exists, it is rewritten.
See also: