Beispiel #1
0
        private void btnCreateRole_Click(object sender, EventArgs e)
        {
            string roleName = Microsoft.VisualBasic.Interaction.InputBox("Please enter a role name", "New Role", "Role", -1, -1);

            if (!string.IsNullOrEmpty(roleName))
            {
                if (roleName != "Administrator")
                {
                    bool success = AzManWriter.CreateRole(roleName, GetSelectedApplication());
                    if (success)
                    {
                        PopulateRolesComboBox(GetSelectedApplication());
                        //Put the new role as the selected role.
                        RolesComboBox.SelectedIndex = RolesComboBox.Items.Count - 1;
                        MessageBox.Show("Role successfully created!", "", MessageBoxButtons.OK);
                    }
                }
                else
                {
                    MessageBox.Show("Administrator role already exist.", "", MessageBoxButtons.OK);
                }
            }
            AllNodescheckBox.Checked = false;
            ApplicationTreeView.CollapseAll();
        }
Beispiel #2
0
 private void btnExpandAll_Click(object sender, EventArgs e)
 {
     if (isTreeViewExpanded)
     {
         ApplicationTreeView.CollapseAll();
         isTreeViewExpanded = false;
         if (GetRootNode() != null)
         {
             GetRootNode().Expand();
         }
     }
     else
     {
         ApplicationTreeView.ExpandAll();
         isTreeViewExpanded = true;
     }
 }
Beispiel #3
0
        private void RolesComboBox_SelectedValueChanged(object sender, EventArgs e)
        {
            if (HasRoles())
            {
                string currentRole = GetSelectedRole();
                if (currentRole == "Administrator")
                {
                    ApplicationTreeView.CollapseAll();
                    ApplicationTreeView.Enabled = false;
                    btnSave.Enabled             = false;
                    AllNodescheckBox.Enabled    = false;
                    btnDeleteRole.Enabled       = false;
                    btnExpandAll.Enabled        = false;
                }
                else
                {
                    ApplicationTreeView.Enabled = true;
                    btnSave.Enabled             = true;
                    AllNodescheckBox.Enabled    = true;
                    btnDeleteRole.Enabled       = true;
                    btnExpandAll.Enabled        = true;
                }
                string oldRole        = _previousRole;
                string oldApplication = _previousApplication;

                TreeNode node = GetRootNode();

                SwitchRole(currentRole, GetSelectedApplication(), oldRole, oldApplication, node);

                _previousRole = currentRole;

                AccessibilitygroupBox.Text = "Role [" + currentRole + "] Settings";
                lblWinUsers.Text           = "Windows Users connected to [" + currentRole + "]";
            }
            else
            {
                _previousRole = null;
            }
            AllNodescheckBox.Checked = false;
            ApplicationTreeView.CollapseAll();
            isRoleSaved = true;
        }
Beispiel #4
0
        private void ApplicationsComboBox_SelectedValueChanged(object sender, EventArgs e)
        {
            string   currentApplication = GetSelectedApplication();
            string   oldApplication     = _previousApplication;
            string   oldRole            = _previousRole;
            TreeNode node = null;

            if (ApplicationTreeView.Nodes.Count > 0)
            {
                node = GetRootNode();
            }

            SwitchApplication(currentApplication, oldApplication, oldRole, node);

            _previousApplication = GetSelectedApplication();
            RemoveCheckboxes(GetRootNode());

            RolegroupBox.Text        = "Role for Application [" + currentApplication + "]";
            AllNodescheckBox.Checked = false;
            ApplicationTreeView.CollapseAll();
        }