mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-01 21:30:30 +01:00
fix: #9085, dont prevent admins from deleting other users
This commit is contained in:
@@ -107,6 +107,7 @@
|
||||
|
||||
"cant-ban-other-admins": "You can't ban other admins!",
|
||||
"cant-remove-last-admin": "You are the only administrator. Add another user as an administrator before removing yourself as admin",
|
||||
"account-deletion-disabled": "Account deletion is disabled",
|
||||
"cant-delete-admin": "Remove administrator privileges from this account before attempting to delete it.",
|
||||
|
||||
"already-deleting": "Already deleting",
|
||||
|
||||
@@ -250,8 +250,8 @@ async function processDeletion({ uid, method, password, caller }) {
|
||||
const isSelf = parseInt(uid, 10) === caller.uid;
|
||||
const isAdmin = await user.isAdministrator(caller.uid);
|
||||
|
||||
if (meta.config.allowAccountDelete !== 1) {
|
||||
throw new Error('[[error:no-privileges]]');
|
||||
if (isSelf && meta.config.allowAccountDelete !== 1) {
|
||||
throw new Error('[[error:account-deletion-disabled]]');
|
||||
} else if (!isSelf && !isAdmin) {
|
||||
throw new Error('[[error:no-privileges]]');
|
||||
} else if (isTargetAdmin) {
|
||||
|
||||
Reference in New Issue
Block a user