return privileges in category

This commit is contained in:
barisusakli
2014-04-16 14:30:36 -04:00
parent 5b8fcbe27e
commit 01555cbb5c
3 changed files with 36 additions and 15 deletions

View File

@@ -68,14 +68,14 @@ categoriesController.get = function(req, res, next) {
async.waterfall([
function(next) {
categoryTools.privileges(cid, uid, function(err, categoryPrivileges) {
if (!err) {
if (!categoryPrivileges.read) {
next(new Error('[[error:no-privileges]]'));
} else {
next(null, categoryPrivileges);
}
if (err) {
return next(err);
}
if (!categoryPrivileges.read) {
next(new Error('[[error:no-privileges]]'));
} else {
next(err);
next(null, categoryPrivileges);
}
});
},