Added access rights feature + read access check

This commit is contained in:
NGPixel
2016-10-31 22:44:00 -04:00
parent 09b4d37f4c
commit a05560e9fc
9 changed files with 122 additions and 17 deletions

View File

@@ -19,6 +19,12 @@ module.exports = (req, res, next) => {
return res.redirect('/login');
}
// Check permissions
if(!rights.check(req, 'read')) {
return res.render('error-forbidden');
}
// Set i18n locale
req.i18n.changeLanguage(req.user.lang);