all files / src/controllers/ globalmods.js

46.67% Statements 7/15
0% Branches 0/8
0% Functions 0/4
46.67% Lines 7/15
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30                                             
"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;