mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-03 20:45:58 +01:00
closes #1924
This commit is contained in:
@@ -24,7 +24,7 @@ topicsController.get = function(req, res, next) {
|
||||
privileges.topics.get(tid, uid, next);
|
||||
},
|
||||
function (privileges, next) {
|
||||
if (!privileges.read) {
|
||||
if (!privileges.read || privileges.disabled) {
|
||||
return next(new Error('[[error:no-privileges]]'));
|
||||
}
|
||||
|
||||
@@ -164,11 +164,7 @@ topicsController.get = function(req, res, next) {
|
||||
}
|
||||
], function (err, data) {
|
||||
if (err) {
|
||||
if (err.message === '[[error:no-privileges]]') {
|
||||
return res.locals.isAPI ? res.json(403, err.message) : res.redirect('403');
|
||||
} else {
|
||||
return res.locals.isAPI ? res.json(404, 'not-found') : res.redirect('404');
|
||||
}
|
||||
return res.locals.isAPI ? res.json(404, 'not-found') : res.redirect(nconf.get('relative_path') + '/404');
|
||||
}
|
||||
|
||||
data.privileges = userPrivileges;
|
||||
|
||||
Reference in New Issue
Block a user