Admin option to allow all users to view votes (#5534)

* Admin option to allow all users to view votes

* Fix </strong></strong>
This commit is contained in:
Ben Lubar
2017-03-17 13:08:47 -05:00
committed by psychobunny
parent da1858f674
commit 7f713ee822
3 changed files with 13 additions and 2 deletions

View File

@@ -6,6 +6,7 @@ var db = require('../../database');
var user = require('../../user');
var posts = require('../../posts');
var privileges = require('../../privileges');
var meta = require('../../meta');
var helpers = require('./helpers');
module.exports = function (SocketPosts) {
@@ -16,6 +17,9 @@ module.exports = function (SocketPosts) {
async.waterfall([
function (next) {
if (parseInt(meta.config.votesArePublic, 10) !== 0) {
return next(null, true);
}
privileges.categories.isAdminOrMod(data.cid, socket.uid, next);
},
function (isAdminOrMod, next) {