|
|
|
@ -12,6 +12,11 @@ var meta = require('../meta');
|
|
|
|
|
var helpers = {};
|
|
|
|
|
|
|
|
|
|
helpers.notAllowed = function(req, res, error) {
|
|
|
|
|
plugins.fireHook('filter:helpers.notAllowed', {
|
|
|
|
|
req: req,
|
|
|
|
|
res: res,
|
|
|
|
|
error: error
|
|
|
|
|
}, function(err, data) {
|
|
|
|
|
if (req.uid) {
|
|
|
|
|
if (res.locals.isAPI) {
|
|
|
|
|
res.status(403).json({
|
|
|
|
@ -35,6 +40,7 @@ helpers.notAllowed = function(req, res, error) {
|
|
|
|
|
res.redirect(nconf.get('relative_path') + '/login');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
helpers.redirect = function(res, url) {
|
|
|
|
|