Add a confirmation when setting admin permissions

This commit is contained in:
Bubka 2024-01-30 16:14:34 +01:00
parent 6aeb7dcbc9
commit f398768f4e
2 changed files with 9 additions and 1 deletions

View File

@ -84,6 +84,13 @@
* @param {boolean} isAdmin
*/
function saveAdminRole(isAdmin) {
if (! confirm(trans('admin.confirm.change_admin_role'))) {
nextTick().then(() => {
managedUser.value.info.is_admin = ! isAdmin
})
return
}
if(isAdmin === false && managedUser.value.info.id === user.id) {
if (! confirm(trans('admin.confirm.demote_own_account'))) {
nextTick().then(() => {

View File

@ -27,7 +27,8 @@ return [
'purge_password_reset_request' => 'Are you sure you want to purge the request?',
'delete_account' => 'Are you sure you want to delete this user?',
'edit_own_account' => 'This is your own account. Are you sure?',
'demote_own_account' => 'You will no longer be an administrator. Are you sure?'
'change_admin_role' => 'This will have serious impacts on this user\'s permissions. Are you sure?',
'demote_own_account' => 'You will no longer be an administrator. Really sure?'
],
'administration' => 'Administration',
'logs' => 'Logs',