mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-17 03:01:08 +01:00
closes #6311
This commit is contained in:
@@ -26,3 +26,18 @@ SocketBlacklist.save = function (socket, rules, callback) {
|
||||
},
|
||||
], callback);
|
||||
};
|
||||
|
||||
SocketBlacklist.addRule = function (socket, rule, callback) {
|
||||
async.waterfall([
|
||||
function (next) {
|
||||
user.isAdminOrGlobalMod(socket.uid, next);
|
||||
},
|
||||
function (isAdminOrGlobalMod, next) {
|
||||
if (!isAdminOrGlobalMod) {
|
||||
return callback(new Error('[[error:no-privileges]]'));
|
||||
}
|
||||
|
||||
meta.blacklist.addRule(rule, next);
|
||||
},
|
||||
], callback);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user