Exemplo n.º 1
0
        private void CreateUserGroupMenuItem_Click(object sender, EventArgs e)
        {
            if (!Security.IsAdministrator(SS.I.UserName) &&
                !Security.HasPrivilege(SS.I.UserName, "CreateUserGroup") &&
                !ServicesIniFile.ReadBool("CreateUserGroupByAnyUser", true))
            {
                MessageBoxMx.ShowError("Your account is not authorized to create and/or edit user groups");
                return;
            }

            string groupName = InputBoxMx.Show("Enter the name of the new user group to be created.", "Create User Group");

            if (Lex.IsNullOrEmpty(groupName))
            {
                return;
            }

            if (UserGroups.LookupExternalName(groupName) != null)
            {
                MessageBoxMx.ShowError("Group \"" + groupName + "\" already exists");
                return;
            }

            DialogResult dr = PermissionsGroupEditor.Show(groupName, true);

            if (dr == DialogResult.OK)
            {
                PermissionsList.ItemNameComboBox.Properties.Items.Clear();                 // rebuild for new group
            }
        }
Exemplo n.º 2
0
        private void ViewUserGroupMenuItem_Click(object sender, EventArgs e)
        {
            List <String> groups = UserGroups.GetAllGroups();

            string groupName = InputBoxMx.Show(
                "Select the User Group that you want to view", "View User Group", "", groups, -1, -1);

            if (Lex.IsNullOrEmpty(groupName))
            {
                return;
            }

            DialogResult dr = PermissionsGroupEditor.Show(groupName, false);

            return;
        }
Exemplo n.º 3
0
        private void EditUserGroupMenuItem_Click(object sender, EventArgs e)
        {
            List <String> groups = UserGroups.GetEditableGroups(SS.I.UserName);

            if (groups.Count == 0)
            {
                MessageBoxMx.ShowError("There are no groups that you are currently authorized to edit");
                return;
            }

            string groupName = InputBoxMx.Show(
                "Select the User Group that you want to edit", "Edit User Group", "", groups, -1, -1);

            if (Lex.IsNullOrEmpty(groupName))
            {
                return;
            }

            DialogResult dr = PermissionsGroupEditor.Show(groupName, true);

            return;
        }