You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nodebb/src/privileges/categories.js

29 lines
485 B
JavaScript

'use strict';
var async = require('async'),
user = require('../user'),
helpers = require('./helpers');
module.exports = function(privileges) {
privileges.categories = {};
privileges.categories.canRead = function(cid, uid, callback) {
helpers.some([
function(next) {
helpers.allowedTo('read', uid, cid, next);
},
function(next) {
user.isModerator(uid, cid, next);
},
function(next) {
user.isAdministrator(uid, next);
}
], callback);
};
};