From b9f539ba19b40361265c7897a73a1f5757ed0e68 Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" Date: Fri, 19 Nov 2010 16:58:55 -0600 Subject: SUDO Commands and Command Groups The SUDO Commands and Command Groups pages have been added under SUDO Rules tab. Similar to HBAC navigation issue, these entities do not have their own tab, so an exception has been added to the navigation code to read sudo-entity parameter to determine the entity being viewed. Fixing this issue will require framework changes. New test data for these operations have been added. --- install/static/sudorule.js | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'install/static/sudorule.js') diff --git a/install/static/sudorule.js b/install/static/sudorule.js index 60cf4d3e9..f936ebcde 100755 --- a/install/static/sudorule.js +++ b/install/static/sudorule.js @@ -92,6 +92,20 @@ function ipa_sudorule_search_facet(spec) { that.create = function(container) { + var action_panel = that.get_action_panel(); + + var ul = $('ul', action_panel); + + $('
  • ', { + title: 'sudocmd', + text: 'SUDO Commands' + }).appendTo(ul); + + $('
  • ', { + title: 'sudocmdgroup', + text: 'SUDO Command Groups' + }).appendTo(ul); + that.search_facet_create(container); // TODO: replace with IPA.metadata[that.entity_name].label @@ -101,6 +115,29 @@ function ipa_sudorule_search_facet(spec) { }; + that.setup = function(container) { + + that.search_facet_setup(container); + + var action_panel = that.get_action_panel(); + + var li = $('li[title=sudocmd]', action_panel); + li.click(function() { + var state = {}; + state['sudo-entity'] = 'sudocmd'; + nav_push_state(state); + return false; + }); + + li = $('li[title=sudocmdgroup]', action_panel); + li.click(function() { + var state = {}; + state['sudo-entity'] = 'sudocmdgroup'; + nav_push_state(state); + return false; + }); + }; + return that; } -- cgit