diff options
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", |