EnforceApplicationRole: Boolean;
EnforceApplicationRole: System.Boolean;
The EnforceApplicationRole property indicates whether it is possible to use application role in security policy.
By default the property is set to False. If the property is set to True, the security policy uses the application role. In this case, the repository database can be accessed only from Foresight Analytics Platform.
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;
Begin
MB := MetabaseClass.Active;
// Check out license to work with security manager
Lic := MB.RequestLicense(UiLicenseFeatureType.Adm);
MS := MB.Security;
Policy := MS.Policy;
// Enable using the application role
Policy.EnforceApplicationRole := 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;
Begin
MB := Params.Metabase;
// Check out license to work with security manager
Lic := MB.RequestLicense(UiLicenseFeatureType.lftAdm);
MS := MB.Security;
Policy := MS.Policy;
// Enable using the application role
Policy.EnforceApplicationRole := True;
// Save changes
MS.Apply();
// Check in license
Lic := Null;
End Sub;
After executing the example the repository database can be accessed only from Foresight Analytics Platform.
See also: