Exemplo n.º 1
0
        protected virtual void showPermissions(Views.View_PermissionExplorer.Tab tabIn)
        {
            int snapshotId = 0;

            if (m_serverInstance != null && Sql.RegisteredServer.IsServerRegistered(m_serverInstance.ConnectionName))
            {
                if (_grid.ActiveRow == null)
                {
                    snapshotId = Forms.Form_SelectSnapshot.GetSnapshotId(m_serverInstance);
                }
                else
                {
                    snapshotId = (int)_grid.ActiveRow.Cells[colId].Value;
                }
                if (snapshotId != 0)
                {
                    Cursor = Cursors.WaitCursor;

                    Program.gController.ShowRootView(new Utility.NodeTag(new Data.PermissionExplorer(m_serverInstance, snapshotId, tabIn),
                                                                         Utility.View.PermissionExplorer));
                    Cursor = Cursors.Default;
                }
            }
            else
            {
                Utility.MsgBox.ShowError(Utility.ErrorMsgs.UserPermissionsCaption, Utility.ErrorMsgs.ServerNotRegistered);
                Program.gController.SignalRefreshServersEvent(false, null);
            }
        }
Exemplo n.º 2
0
        public PermissionExplorer(Sql.RegisteredServer serverIn, Views.View_PermissionExplorer.Tab showTabIn)
        {
            Debug.Assert(serverIn != null, "Permission Explorer called with null server");

            m_ServerInstance = serverIn;
            m_Name           = serverIn.ConnectionName;
            m_Tab            = showTabIn;

            Program.gController.SetCurrentServer(m_ServerInstance);
        }
Exemplo n.º 3
0
        public PermissionExplorer(Sql.RegisteredServer serverIn, int snapShotId, Views.View_PermissionExplorer.Tab showTabIn)
        {
            Debug.Assert(serverIn != null, "Permission Explorer called with null server");
            Debug.Assert(snapShotId != 0, "Permission Explorer called with invalid SnapShotId");

            m_ServerInstance = serverIn;
            m_Name           = serverIn.ConnectionName;
            m_SnapShotId     = snapShotId;
            m_Tab            = showTabIn;

            Program.gController.SetCurrentSnapshot(m_ServerInstance, snapShotId);
        }
Exemplo n.º 4
0
        protected void showPermissions(Views.View_PermissionExplorer.Tab tab)
        {
            Debug.Assert(!(_grid_Servers.ActiveRow == null), "No selected server row in grid");

            if (_grid_Servers.ActiveRow != null)
            {
                string server = _grid_Servers.ActiveRow.Cells[colServer].Text;

                Sql.RegisteredServer registeredServer = Program.gController.Repository.RegisteredServers.Find(server);

                Program.gController.ShowRootView(new Utility.NodeTag(new Data.PermissionExplorer(registeredServer, tab),
                                                                     Utility.View.PermissionExplorer));
            }
        }
Exemplo n.º 5
0
 protected override void showPermissions(Views.View_PermissionExplorer.Tab tabIn)
 {
     if (m_serverInstance != null && Sql.RegisteredServer.IsServerRegistered(m_serverInstance.ConnectionName))
     {
         Program.gController.SetCurrentServer(m_serverInstance);
         Program.gController.ShowRootView(new Utility.NodeTag(new Data.PermissionExplorer(m_serverInstance, tabIn),
                                                              Utility.View.PermissionExplorer));
     }
     else
     {
         Utility.MsgBox.ShowError(this.Title, Utility.ErrorMsgs.ServerNotRegistered);
         Program.gController.SignalRefreshServersEvent(false, null);
     }
 }
 protected override void showPermissions(Views.View_PermissionExplorer.Tab tabIn)
 {
     try
     {
         if (_grid.ActiveRow == null)
         {
             if (tabIn == Views.View_PermissionExplorer.Tab.UserPermissions)
             {
                 Forms.Form_WizardUserPermissions.Process();
             }
             else if (tabIn == Views.View_PermissionExplorer.Tab.ObjectPermissions)
             {
                 Forms.Form_WizardObjectPermissions.Process();
             }
             else
             {
                 Sql.RegisteredServer server = Forms.Form_SelectRegisteredServer.GetServer(true);
                 if (server != null)
                 {
                     //Program.gController.SetCurrentServer(server);
                     Program.gController.ShowRootView(new Utility.NodeTag(new Data.PermissionExplorer(server, tabIn),
                                                                          Utility.View.PermissionExplorer));
                 }
             }
         }
         else
         {
             Sql.RegisteredServer registeredServer = Sql.RegisteredServer.GetServer(_grid.ActiveRow.Cells[colServer].Text);
             if (registeredServer != null)
             {
                 //Program.gController.SetCurrentServer(registeredServer);
                 Program.gController.ShowRootView(new Utility.NodeTag(new Data.PermissionExplorer(registeredServer, tabIn),
                                                                      Utility.View.PermissionExplorer));
             }
             else
             {
                 Utility.MsgBox.ShowError(this.Title, Utility.ErrorMsgs.ServerNotRegistered);
                 Program.gController.SignalRefreshServersEvent(false, null);
                 ShowRefresh();
             }
         }
     }
     catch (Exception ex)
     {
         Utility.MsgBox.ShowError(this.Title, Utility.ErrorMsgs.ErrorProcessUserPermissions, ex);
     }
 }
Exemplo n.º 7
0
 protected virtual void showPermissions(Views.View_PermissionExplorer.Tab tabIn)
 {
     if (tabIn == Views.View_PermissionExplorer.Tab.UserPermissions)
     {
         Forms.Form_WizardUserPermissions.Process();
     }
     else if (tabIn == Views.View_PermissionExplorer.Tab.ObjectPermissions)
     {
         Forms.Form_WizardObjectPermissions.Process();
     }
     else
     {
         Sql.RegisteredServer server = Forms.Form_SelectRegisteredServer.GetServer(true);
         if (server != null)
         {
             Program.gController.SetCurrentServer(server);
             Program.gController.ShowRootView(new Utility.NodeTag(new Data.PermissionExplorer(server, tabIn),
                                                                  Utility.View.PermissionExplorer));
         }
     }
 }
Exemplo n.º 8
0
 private void showPermissions(Views.View_PermissionExplorer.Tab tabIn)
 {
     // This has a base function that requires no input, so can be defaulted from here or overriden
     if (tabIn == View_PermissionExplorer.Tab.UserPermissions)
     {
         Forms.Form_WizardUserPermissions.Process();
     }
     else if (tabIn == View_PermissionExplorer.Tab.ObjectPermissions)
     {
         Forms.Form_WizardObjectPermissions.Process();
     }
     else
     {
         Sql.RegisteredServer server = Forms.Form_SelectRegisteredServer.GetServer(true);
         if (server != null)
         {
             Program.gController.SetCurrentServer(server);
             Program.gController.ShowRootView(new Utility.NodeTag(new Data.PermissionExplorer(server, tabIn),
                                                                  Utility.View.PermissionExplorer));
         }
     }
 }
Exemplo n.º 9
0
        private void showPermissions(Views.View_PermissionExplorer.Tab tab)
        {
            Sql.RegisteredServer server = m_server;

            if (_ultraToolbarsManager.Ribbon.SelectedTab.Key == RibbonTabView.Users &&
                tab == Views.View_PermissionExplorer.Tab.UserPermissions)
            {
                if (_policyUsers.SelectedServer != null)
                {
                    server = _policyUsers.SelectedServer;
                    if (_policyUsers.SelectedUser != null)
                    {
                        int snapshotid;
                        m_policy.PolicySnapshotList.TryGetValue(server.RegisteredServerId, out snapshotid);

                        if (snapshotid > 0)
                        {
                            Program.gController.ShowRootView(new NodeTag(new Data.PermissionExplorer(server, snapshotid, _policyUsers.SelectedUser, tab),
                                                                         Utility.View.PermissionExplorer));
                        }

                        return;
                    }
                }
            }
            else if (_ultraToolbarsManager.Ribbon.SelectedTab.Key == RibbonTabView.Settings)
            {
                if (_sqlServerSettings.SelectedServer != null)
                {
                    server = _sqlServerSettings.SelectedServer;

                    int snapshotid;
                    m_policy.PolicySnapshotList.TryGetValue(server.RegisteredServerId, out snapshotid);

                    if (snapshotid > 0)
                    {
                        Program.gController.ShowRootView(new NodeTag(new Data.PermissionExplorer(server, snapshotid, _policyUsers.SelectedUser, tab),
                                                                     Utility.View.PermissionExplorer));
                    }
                }
            }

            if (server == null)
            {
                if (tab == Views.View_PermissionExplorer.Tab.UserPermissions)
                {
                    Forms.Form_WizardUserPermissions.Process();
                }
                else if (tab == Views.View_PermissionExplorer.Tab.ObjectPermissions)
                {
                    Forms.Form_WizardObjectPermissions.Process();
                }
                else
                {
                    server = Forms.Form_SelectRegisteredServer.GetServer();
                }
            }
            if (server != null)
            {
                int snapshotid;
                m_policy.PolicySnapshotList.TryGetValue(server.RegisteredServerId, out snapshotid);

                if (snapshotid > 0)
                {
                    Program.gController.ShowRootView(new NodeTag(new Data.PermissionExplorer(server, snapshotid, tab),
                                                                 Utility.View.PermissionExplorer));
                }
                else
                {
                    Program.gController.ShowRootView(new NodeTag(new Data.PermissionExplorer(server, tab),
                                                                 Utility.View.PermissionExplorer));
                }
            }
        }
Exemplo n.º 10
0
 protected virtual void showPermissions(Views.View_PermissionExplorer.Tab tabIn)
 {
     // This should be overriden if needed by the View and should never be called
     logX.loggerX.Error("Error - PolicyChangeLog showProperties command called erroneously");
 }
Exemplo n.º 11
0
 protected virtual void showPermissions(Views.View_PermissionExplorer.Tab tabIn)
 {
     // This should be overriden if needed by the View and should never be called
     logX.loggerX.Error("Error - SqlServerSettings showPermissions command called erroneously");
 }