AllowedDocumentFormats: IStringList;
AllowedDocumentFormats: Prognoz.Platform.Interop.ForeCollections.StringList;
The AllowedDocumentFormats property determines formats documentsthat can be loaded and opened in repository.
To limit loading and opening of documents available format, use the Allowed Document Format in Repositorysection in security manager is made for it. By default, any format documents can be loaded and opened.
To execute the example, add links to the Metabase, Collections (ForeCollections), ForeSystem (for Fore.NET example) system assemblies.
Sub UserProc;
Var
MB: IMetabase;
MS: IMetabaseSecurity;
Lic: Object;
Begin
MB := MetabaseClass.Active;
// Get license to work with security manager
Lic := MB.RequestLicense(UiLicenseFeatureType.Adm);
MS := MB.Security;
// Add allowed document format
MS.Policy.AllowedDocumentFormats.Add("XML");
// Save changes
MS.Apply;
// Check in license
Lic := Null;
End Sub UserProc;
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.ForeCollections;
Imports Prognoz.Platform.Interop.ForeSystem;
…
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
MS: IMetabaseSecurity;
Lic: Object;
Begin
MB := Params.Metabase;
// Get license to work with security manager
Lic := MB.RequestLicense(UiLicenseFeatureType.lftAdm);
MS := MB.Security;
// Add allowed document format
MS.Policy.AllowedDocumentFormats.Add("XML");
// Save changes
MS.Apply();
// Check in license
Lic := Null;
End Sub;
After executing the example, documents in the XML format can be loaded and opened.
See also: