OpenNavigator Command

Purpose

Opens security manager for the specified repository.

Parameters of Use

Command parameters are passed in the Data property. Executing the command requires to specify an array of the Variant type in this property, the elements of this array contain the following values:

Parameter Description
Element 1: IUiSecManagerParams Parameter determining display settings and section editing options. Contains settings of the repository, for which security manager should be opened.

Application Features

It is used to open security manager window for a repository. If a repository (value of the IUiSecManagerParams.Metabase property is equal to Null) is not determined in parameters, the result of command work will be opened security manager without connection to a repository.

Parameters can be used to hide sections, open sections in read-only mode, prohibit policy saving, disable controls.

Visibility and reading settings are set up using tab displaying parameter properties: IUISecManagerTabParams.ReadOnly and IUISecManagerTabParams.Visible.

Fore Example

Executing the example requires a form and the Button1 button on the form. Add links to the Metabase, Ui system assemblies.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    Target: IUiCommandTarget;
    Context: IUiCommandExecutionContext;
    SecParams: IUiSecManagerParams;
Begin
    Target := WinApplication.Instance.GetPluginTarget("Adm");
    Context := Target.CreateExecutionContext;
    SecParams := new UiSecManagerParams.Create;
    SecParams.Metabase := MetabaseClass.Active; // 1. Set repository
    //Tab parameters
    SecParams.EnablePolicySave(False); // 2. Prohibit policy saving
    SecParams.Privilege.Visible := False// 3. Hide the Privileges, Mandatory Access and Security violation monitoring tabs
    SecParams.Mandatory.Visible := False;
    SecParams.SecurityWatch.Visible := False;
    SecParams.Service.ReadOnly:= True; // 4. Enable read-only mode for the Service tab
    SecParams.RepositoryMenuEnabled := False// 5. Disable items in the Repository menu (except the Disable and Exit items)
    SecParams.ServiceMenuEnabled := False// 6. Disable items in the Service menu
    SecParams.Users.ObjectRightsEnabled := False// 7. For the Users tab, disable to select the dialog box with object properties
    //Call a security manager
    Context.Data := SecParams;
    Target.Execute("OpenNavigator", Context);
End Sub Button1OnClick;

Clicking the button opens security manager dialog box with particular settings: a part of sections will not be available, policy changing will be prohibited.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example. Use Fore.NET analogs instead of Fore components.

Imports Prognoz.Platform.Interop.Ui;
Imports Prognoz.Platform.Interop.Metabase;

Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
    WinApp: WinApplication = New WinApplicationClass_2();
    Target: IUiCommandTarget;
    Context: IUiCommandExecutionContext;
    SecParams: IUiSecManagerParams;
Begin
    Target := WinApp.GetPluginTarget("Adm");
    Context := Target.CreateExecutionContext();
    SecParams := new UiSecManagerParams.Create();
    SecParams.Metabase := Self.Metabase; // 1. Set repository
    //Tab parameters
    SecParams.EnablePolicySave(False); // 2. Disable policy saving
    SecParams.Privilege.Visible := False// 3. Hide the Privileges, Mandatory Access, Security Violation Monitoring and Service tabs
    SecParams.Mandatory.Visible := False;
    SecParams.SecurityWatch.Visible := False;
    SecParams.Service.Visible := False;
    SecParams.RepositoryMenuEnabled := False// 4. Disable items in the Repository menu (except the Disable and Exit items)
    SecParams.ServiceMenuEnabled := False// 5. Disable the Service menu items
    SecParams.Users.ObjectRightsEnabled := False// 6. For the Users tab, disable to select the dialog box with object properties
    //Call a security manager
    Context.Data := SecParams;
    Target.Execute("OpenNavigator", Context, Null);
End Sub;

See also:

IUiCommandTarget.Execute