mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
webui: add confirmation for dns zone permission actions
All header actions should require confirmation. Reviewed-By: Endi Sukma Dewata <edewata@redhat.com>
This commit is contained in:
parent
8568f66cff
commit
8ca5793160
@ -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;
|
||||
};
|
||||
|
||||
|
@ -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",
|
||||
|
@ -422,7 +422,9 @@ class i18n_messages(Command):
|
||||
"dnszone": {
|
||||
"identity": _("DNS Zone Settings"),
|
||||
"add_permission":_("Add 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"),
|
||||
|
Loading…
Reference in New Issue
Block a user