|
|
@ -26,12 +26,12 @@ postsController.redirectToPost = function (req, res, next) {
|
|
|
|
}, next);
|
|
|
|
}, next);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
function (results, next) {
|
|
|
|
function (results, next) {
|
|
|
|
if (!results.canRead) {
|
|
|
|
|
|
|
|
return helpers.notAllowed(req, res);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!results.path) {
|
|
|
|
if (!results.path) {
|
|
|
|
return next();
|
|
|
|
return next();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!results.canRead) {
|
|
|
|
|
|
|
|
return helpers.notAllowed(req, res);
|
|
|
|
|
|
|
|
}
|
|
|
|
helpers.redirect(res, results.path);
|
|
|
|
helpers.redirect(res, results.path);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
], next);
|
|
|
|
], next);
|
|
|
|