feat: add confirmation modal when assigning admin:admins-mods privilege

v1.18.x
Julian Lam 4 years ago
parent fb46a8d975
commit d90aa95808

@ -44,6 +44,7 @@
"admin-settings": "Settings", "admin-settings": "Settings",
"alert.confirm-moderate": "<strong>Are you sure you wish to grant the moderation privilege to this user group?</strong> This group is public, and any users can join at will.", "alert.confirm-moderate": "<strong>Are you sure you wish to grant the moderation privilege to this user group?</strong> This group is public, and any users can join at will.",
"alert.confirm-admins-mods": "<strong>Are you sure you wish to grant the &quot;Admins &amp; Mods&quot; privilege to this user/group?</strong> Users with this privilege are able to promote and demote other users into privileged positions, <em>including super administrator</em>",
"alert.confirm-save": "Please confirm your intention to save these privileges", "alert.confirm-save": "Please confirm your intention to save these privileges",
"alert.saved": "Privilege changes saved and applied", "alert.saved": "Privilege changes saved and applied",
"alert.confirm-discard": "Are you sure you wish to discard your privilege changes?", "alert.confirm-discard": "Are you sure you wish to discard your privilege changes?",

@ -50,6 +50,15 @@ define('admin/manage/privileges', [
checkboxEl.prop('checked', !checkboxEl.prop('checked')); checkboxEl.prop('checked', !checkboxEl.prop('checked'));
} }
}); });
} else if (privilege.endsWith('admin:admins-mods') && state) {
bootbox.confirm('[[admin/manage/privileges:alert.confirm-admins-mods]]', function (confirm) {
if (confirm) {
wrapperEl.attr('data-delta', delta);
Privileges.exposeAssumedPrivileges();
} else {
checkboxEl.prop('checked', !checkboxEl.prop('checked'));
}
});
} else { } else {
wrapperEl.attr('data-delta', delta); wrapperEl.attr('data-delta', delta);
Privileges.exposeAssumedPrivileges(); Privileges.exposeAssumedPrivileges();

Loading…
Cancel
Save