mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-03 20:45:58 +01:00
closes #4367
This commit is contained in:
29
src/controllers/globalmods.js
Normal file
29
src/controllers/globalmods.js
Normal file
@@ -0,0 +1,29 @@
|
||||
"use strict";
|
||||
|
||||
var user = require('../user');
|
||||
var adminFlagsController = require('./admin/flags');
|
||||
var adminBlacklistController = require('./admin/blacklist');
|
||||
|
||||
var globalModsController = {};
|
||||
|
||||
globalModsController.flagged = function(req, res, next) {
|
||||
user.isAdminOrGlobalMod(req.uid, function(err, isAdminOrGlobalMod) {
|
||||
if (err || !isAdminOrGlobalMod) {
|
||||
return next(err);
|
||||
}
|
||||
|
||||
adminFlagsController.get(req, res, next);
|
||||
});
|
||||
};
|
||||
|
||||
globalModsController.ipBlacklist = function(req, res, next) {
|
||||
user.isAdminOrGlobalMod(req.uid, function(err, isAdminOrGlobalMod) {
|
||||
if (err || !isAdminOrGlobalMod) {
|
||||
return next(err);
|
||||
}
|
||||
|
||||
adminBlacklistController.get(req, res, next);
|
||||
});
|
||||
};
|
||||
|
||||
module.exports = globalModsController;
|
||||
Reference in New Issue
Block a user