summaryrefslogtreecommitdiffstats
path: root/install/static/sudorule.js
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2010-12-02 22:12:59 -0600
committerAdam Young <ayoung@redhat.com>2010-12-06 15:29:02 -0500
commit69e77212ea428f79742b9ff0452ef19d74cc76d4 (patch)
tree7e983cc373e099284743ff274e42cf0ac6ea8c19 /install/static/sudorule.js
parent10f3c0825bfdffa6035e78066001eb3bdc759143 (diff)
downloadfreeipa.git-69e77212ea428f79742b9ff0452ef19d74cc76d4.tar.gz
freeipa.git-69e77212ea428f79742b9ff0452ef19d74cc76d4.tar.xz
freeipa.git-69e77212ea428f79742b9ff0452ef19d74cc76d4.zip
HBAC Service Groups adjustments
The association facet for HBAC Service Groups has been removed and replaced with an association table in the details page. The ipa_association_table_widget has been modified to support multiple columns in the table itself and in the adder dialog. The ipa_association_adder_dialog and ipa_association_facet have been refactored. The ipa_sudorule_association_widget and ipa_rule_association_widget has been removed because their functionalities have been merged into ipa_association_table_widget.
Diffstat (limited to 'install/static/sudorule.js')
-rwxr-xr-xinstall/static/sudorule.js60
1 files changed, 8 insertions, 52 deletions
diff --git a/install/static/sudorule.js b/install/static/sudorule.js
index 9e0e4e58..7c290ac1 100755
--- a/install/static/sudorule.js
+++ b/install/static/sudorule.js
@@ -135,12 +135,12 @@ function ipa_sudorule_details_facet(spec) {
});
that.add_section(section);
- section.add_field(ipa_sudorule_association_widget({
+ section.add_field(ipa_association_table_widget({
'id': that.entity_name+'-memberuser_user',
'name': 'memberuser_user', 'label': 'Users',
'other_entity': 'user', 'add_method': 'add_user', 'remove_method': 'remove_user'
}));
- section.add_field(ipa_sudorule_association_widget({
+ section.add_field(ipa_association_table_widget({
'id': that.entity_name+'-memberuser_group',
'name': 'memberuser_group', 'label': 'Groups',
'other_entity': 'group', 'add_method': 'add_user', 'remove_method': 'remove_user'
@@ -157,12 +157,12 @@ function ipa_sudorule_details_facet(spec) {
});
that.add_section(section);
- section.add_field(ipa_sudorule_association_widget({
+ section.add_field(ipa_association_table_widget({
'id': that.entity_name+'-memberhost_host',
'name': 'memberhost_host', 'label': 'Host',
'other_entity': 'host', 'add_method': 'add_host', 'remove_method': 'remove_host'
}));
- section.add_field(ipa_sudorule_association_widget({
+ section.add_field(ipa_association_table_widget({
'id': that.entity_name+'-memberhost_hostgroup',
'name': 'memberhost_hostgroup', 'label': 'Groups',
'other_entity': 'hostgroup', 'add_method': 'add_host', 'remove_method': 'remove_host'
@@ -179,12 +179,12 @@ function ipa_sudorule_details_facet(spec) {
});
that.add_section(section);
- section.add_field(ipa_sudorule_association_widget({
+ section.add_field(ipa_association_table_widget({
'id': that.entity_name+'-memberallowcmd_sudocmd',
'name': 'memberallowcmd_sudocmd', 'label': 'Command',
'other_entity': 'sudocmd', 'add_method': 'add_allow_command', 'remove_method': 'remove_allow_command'
}));
- section.add_field(ipa_sudorule_association_widget({
+ section.add_field(ipa_association_table_widget({
'id': that.entity_name+'-memberallowcmd_sudocmdgroup',
'name': 'memberallowcmd_sudocmdgroup', 'label': 'Groups',
'other_entity': 'sudocmdgroup', 'add_method': 'add_allow_command', 'remove_method': 'remove_allow_command'
@@ -201,12 +201,12 @@ function ipa_sudorule_details_facet(spec) {
});
that.add_section(section);
- section.add_field(ipa_sudorule_association_widget({
+ section.add_field(ipa_association_table_widget({
'id': that.entity_name+'-memberdenycmd_sudocmd',
'name': 'memberdenycmd_sudocmd', 'label': 'Command',
'other_entity': 'sudocmd', 'add_method': 'add_deny_command', 'remove_method': 'remove_deny_command'
}));
- section.add_field(ipa_sudorule_association_widget({
+ section.add_field(ipa_association_table_widget({
'id': that.entity_name+'-memberdenycmd_sudocmdgroup',
'name': 'memberdenycmd_sudocmdgroup', 'label': 'Groups',
'other_entity': 'sudocmdgroup', 'add_method': 'add_deny_command', 'remove_method': 'remove_deny_command'
@@ -217,47 +217,3 @@ function ipa_sudorule_details_facet(spec) {
return that;
}
-
-function ipa_sudorule_association_widget(spec) {
-
- spec = spec || {};
-
- var that = ipa_rule_association_widget(spec);
-
- that.add = function(values, on_success, on_error) {
-
- var pkey = $.bbq.getState(that.entity_name + '-pkey', true) || '';
-
- var command = ipa_command({
- 'method': that.entity_name+'_'+that.add_method,
- 'args': [pkey],
- 'on_success': on_success,
- 'on_error': on_error
- });
- command.set_option(that.other_entity, values.join(','));
-
- command.execute();
- };
-
- that.remove = function(values, on_success, on_error) {
-
- var pkey = $.bbq.getState(that.entity_name + '-pkey', true) || '';
-
- var command = ipa_command({
- 'method': that.entity_name+'_'+that.remove_method,
- 'args': [pkey],
- 'on_success': on_success,
- 'on_error': on_error
- });
-
- command.set_option(that.other_entity, values.join(','));
-
- command.execute();
- };
-
- that.save = function() {
- return null;
- };
-
- return that;
-} \ No newline at end of file