mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-27 17:16:14 +01:00
fix: #8135
This commit is contained in:
@@ -375,10 +375,12 @@ async function canModifyGroup(uid, groupName) {
|
||||
}
|
||||
const results = await utils.promiseParallel({
|
||||
isOwner: groups.ownership.isOwner(uid, groupName),
|
||||
isAdminOrGlobalMod: user.isAdminOrGlobalMod(uid),
|
||||
system: groups.getGroupField(groupName, 'system'),
|
||||
isAdmin: user.isAdministrator(uid),
|
||||
isGlobalMod: user.isGlobalModerator(uid),
|
||||
});
|
||||
|
||||
if (!results.isOwner && !results.isAdminOrGlobalMod) {
|
||||
if (!(results.isOwner || results.isAdmin || (results.isGlobalMod && !results.system))) {
|
||||
throw new Error('[[error:no-privileges]]');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user