helpers.notAllowed hook

v1.18.x
psychobunny 9 years ago
parent 41af78dcd2
commit 371abba13b

@ -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) {

Loading…
Cancel
Save