fix: #9085, dont prevent admins from deleting other users

This commit is contained in:
Barış Soner Uşaklı
2020-12-09 10:15:30 -05:00
parent ff2aa17bbc
commit 0f480be658
2 changed files with 3 additions and 2 deletions

View File

@@ -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) {