mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-30 11:19:54 +01:00
more flagged posts shenanigans
This commit is contained in:
@@ -34,13 +34,10 @@ module.exports = function(SocketUser) {
|
||||
|
||||
async.waterfall([
|
||||
function (next) {
|
||||
async.parallel({
|
||||
isAdmin: async.apply(user.isAdministrator, uid),
|
||||
isGlobalMod: async.apply(user.isGlobalModerator, uid)
|
||||
}, next);
|
||||
user.isAdminOrGlobalMod(uid, next);
|
||||
},
|
||||
function (results, next) {
|
||||
if (!results.isAdmin && !results.isGlobalMod) {
|
||||
function (isAdminOrGlobalMod, next) {
|
||||
if (!isAdminOrGlobalMod) {
|
||||
return next(new Error('[[error:no-privileges]]'));
|
||||
}
|
||||
async.each(uids, method, next);
|
||||
|
||||
Reference in New Issue
Block a user