mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 20:16:04 +01:00
fix: #9085, dont prevent admins from deleting other users
This commit is contained in:
@@ -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