diff options
author | Petr Vobornik <pvoborni@redhat.com> | 2014-06-24 10:39:16 +0200 |
---|---|---|
committer | Petr Vobornik <pvoborni@redhat.com> | 2014-06-27 14:18:33 +0200 |
commit | 8ca5793160cf24268c405e51b0bb8ce267608b6b (patch) | |
tree | f40ca18f0f2cfa79863e061a0afd358d3fcb7e49 /install/ui | |
parent | 8568f66cff157d9359c30e876e8586f0141e137f (diff) | |
download | freeipa-8ca5793160cf24268c405e51b0bb8ce267608b6b.tar.gz freeipa-8ca5793160cf24268c405e51b0bb8ce267608b6b.tar.xz freeipa-8ca5793160cf24268c405e51b0bb8ce267608b6b.zip |
webui: add confirmation for dns zone permission actions
All header actions should require confirmation.
Reviewed-By: Endi Sukma Dewata <edewata@redhat.com>
Diffstat (limited to 'install/ui')
-rw-r--r-- | install/ui/src/freeipa/dns.js | 48 | ||||
-rw-r--r-- | install/ui/test/data/ipa_init.json | 4 |
2 files changed, 11 insertions, 41 deletions
diff --git a/install/ui/src/freeipa/dns.js b/install/ui/src/freeipa/dns.js index a54985d52..9ec255f57 100644 --- a/install/ui/src/freeipa/dns.js +++ b/install/ui/src/freeipa/dns.js @@ -581,29 +581,13 @@ IPA.dns.add_permission_action = function(spec) { spec = spec || {}; spec.name = spec.name || 'add_permission'; + spec.method = spec.method || 'add_permission'; spec.label = spec.label || '@i18n:objects.dnszone.add_permission'; spec.enable_cond = spec.enable_cond || ['permission-none', 'managedby_w']; + spec.needs_confirm = spec.needs_confirm !== undefined ? spec.needs_confirm : true; + spec.confirm_msg = spec.confirm_msg || '@i18n:objects.dnszone.add_permission_confirm'; - var that = IPA.action(spec); - - that.execute_action = function(facet) { - - var pkey = facet.get_pkey(); - - var command = rpc.command({ - entity: 'dnszone', - method: 'add_permission', - args: [pkey], - options: {}, - on_success: function(data, text_status, xhr) { - facet.refresh(); - IPA.notify_success(data.result.summary); - } - }); - - command.execute(); - }; - + var that = IPA.object_action(spec); return that; }; @@ -611,29 +595,13 @@ IPA.dns.remove_permission_action = function(spec) { spec = spec || {}; spec.name = spec.name || 'remove_permission'; + spec.method = spec.method || 'remove_permission'; spec.label = spec.label || '@i18n:objects.dnszone.remove_permission'; spec.enable_cond = spec.enable_cond || ['permission-set', 'managedby_w']; + spec.needs_confirm = spec.needs_confirm !== undefined ? spec.needs_confirm : true; + spec.confirm_msg = spec.confirm_msg || '@i18n:objects.dnszone.remove_permission_confirm'; - var that = IPA.action(spec); - - that.execute_action = function(facet) { - - var pkey = facet.get_pkey(); - - var command = rpc.command({ - entity: 'dnszone', - method: 'remove_permission', - args: [pkey], - options: {}, - on_success: function(data, text_status, xhr) { - facet.refresh(); - IPA.notify_success(data.result.summary); - } - }); - - command.execute(); - }; - + var that = IPA.object_action(spec); return that; }; diff --git a/install/ui/test/data/ipa_init.json b/install/ui/test/data/ipa_init.json index 2ce5120e9..daba71b9a 100644 --- a/install/ui/test/data/ipa_init.json +++ b/install/ui/test/data/ipa_init.json @@ -283,7 +283,9 @@ "dnszone": { "identity": "DNS Zone Settings", "add_permission": "Add Permission", - "remove_permission": "Remove Permission" + "add_permission_confirm":"Are you sure you want to add permission for DNS Zone ${object}?", + "remove_permission": "Remove Permission", + "remove_permission_confirm": "Are you sure you want to remove permission for DNS Zone ${object}?" }, "group": { "details": "Group Settings", |