private void OkBTN_Click(object sender, EventArgs e) { try { IList <ApplicationAccessRule> rules = AccessRulesCTRL.GetAccessRules(); ApplicationAccessRule.SetAccessRules(ObjectPathTB.Text, rules, true); AccessRulesCTRL.Initialize((SecuredObject)ObjectTypeCB.SelectedItem, ObjectPathTB.Text); if (sender == OkBTN) { DialogResult = DialogResult.OK; } } catch (Exception exception) { GuiUtils.HandleException(this.Text, MethodBase.GetCurrentMethod(), exception); } }
private void ApplyAllBTN_Click(object sender, EventArgs e) { try { StringBuilder buffer = new StringBuilder(); buffer.Append("The following objects will be affected:"); buffer.Append("\r\n\r\n"); foreach (SecuredObject objectType in ObjectTypeCB.Items) { buffer.Append(objectType); buffer.Append("\r\n"); } buffer.Append("\r\n"); buffer.Append("Are you sure you would like to apply access control changes to all of the objects listed above?"); if (new YesNoDlg().ShowDialog(buffer.ToString(), "Confirm Access Rule Changes") != DialogResult.Yes) { return; } IList <ApplicationAccessRule> rules = AccessRulesCTRL.GetAccessRules(); for (int ii = 0; ii < m_objectPaths.Count; ii++) { ApplicationAccessRule.SetAccessRules(m_objectPaths[ii], rules, true); } AccessRulesCTRL.Initialize((SecuredObject)ObjectTypeCB.SelectedItem, ObjectPathTB.Text); } catch (Exception exception) { GuiUtils.HandleException(this.Text, MethodBase.GetCurrentMethod(), exception); } }