From f1b83198da67b6cbf49209371b8a96536a13703e Mon Sep 17 00:00:00 2001 From: Petr Vobornik Date: Thu, 29 May 2014 14:27:08 +0200 Subject: webui: control sudo rule deny command tables by category switch `memberdenycmd_sudocmd` and `memberdenycmd_sudocmdgroup` tables are now enabled/disabled based on `cmdcategory` as well. https://fedorahosted.org/freeipa/ticket/4361 Reviewed-By: Nathaniel McCallum --- install/ui/src/freeipa/rule.js | 54 ++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 28 deletions(-) (limited to 'install/ui/src/freeipa/rule.js') diff --git a/install/ui/src/freeipa/rule.js b/install/ui/src/freeipa/rule.js index f8d182b38..7ad08e1f2 100644 --- a/install/ui/src/freeipa/rule.js +++ b/install/ui/src/freeipa/rule.js @@ -43,9 +43,10 @@ IPA.rule_details_widget = function(spec) { that.init = function() { - that.enable_radio = IPA.radio_widget({ + that.enable_radio = IPA.rule_radio_widget({ name: that.radio_name, - options: that.options + options: that.options, + entity: that.entity }); that.widgets.add_widget(that.enable_radio); @@ -65,41 +66,38 @@ IPA.rule_details_widget = function(spec) { } }; - that.create = function(container) { - - that.container = container; + that.init(); - //enable radios - var param_info = IPA.get_entity_param(that.entity.name, that.radio_name); - var title = param_info ? param_info.doc : that.radio_name; - var enable_radio_container = $('
', { - name: that.radio_name, - title: title, - 'class': 'field' - }).appendTo(container); + return that; +}; - enable_radio_container.append(title+': '); - that.enable_radio.create(enable_radio_container); +/** + * Rule radio widget + * + * Intended to be used especially by rule widget. + * + * @class IPA.rule_radio_widget + * @extends IPA.radio_widget + */ +IPA.rule_radio_widget = function(spec) { - //tables - for (var j=0; j', { - name: table.name, - title: metadata ? metadata.doc : table.name, - 'class': 'field' - }).appendTo(container); + var param_info = IPA.get_entity_param(that.entity.name, that.name); + var title = param_info ? param_info.doc : that.name; - var widget = that.widgets.get_widget(table.name); - widget.create(table_container); + container.append(title + ': '); + that.widget_create(container); + that.owb_create(container); + if (that.undo) { + that.create_undo(container); } }; - that.init(); - return that; }; -- cgit