mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-12 01:27:38 +01:00
dont display all categories
This commit is contained in:
@@ -188,7 +188,7 @@ var db = require('./database'),
|
||||
});
|
||||
};
|
||||
|
||||
Categories.getVisibleCategories = function(uid, callback) {
|
||||
Categories.getCategoriesByPrivilege = function(uid, privilege, callback) {
|
||||
db.getSortedSetRange('categories:cid', 0, -1, function(err, cids) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
@@ -198,7 +198,7 @@ var db = require('./database'),
|
||||
return callback(null, []);
|
||||
}
|
||||
|
||||
privileges.categories.filter('find', cids, uid, function(err, cids) {
|
||||
privileges.categories.filter(privilege, cids, uid, function(err, cids) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ Controllers.home = function(req, res, next) {
|
||||
},
|
||||
categories: function (next) {
|
||||
var uid = req.user ? req.user.uid : 0;
|
||||
categories.getVisibleCategories(uid, function (err, categoryData) {
|
||||
categories.getCategoriesByPrivilege(uid, 'find', function (err, categoryData) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ var path = require('path'),
|
||||
async.parallel([
|
||||
function(next) {
|
||||
var categoryUrls = [];
|
||||
categories.getVisibleCategories(0, function(err, categoriesData) {
|
||||
categories.getCategoriesByPrivilege(0, 'find', function(err, categoriesData) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ SocketCategories.getRecentReplies = function(socket, cid, callback) {
|
||||
};
|
||||
|
||||
SocketCategories.get = function(socket, data, callback) {
|
||||
categories.getAllCategories(callback);
|
||||
categories.getCategoriesByPrivilege(socket.uid, 'find', callback);
|
||||
};
|
||||
|
||||
SocketCategories.loadMore = function(socket, data, callback) {
|
||||
|
||||
Reference in New Issue
Block a user