This commit is contained in:
Christopher Cookman 2025-08-31 13:33:03 -06:00
parent 7d64d0e78a
commit 2426b77f6c
2 changed files with 2 additions and 5 deletions

View file

@ -44,10 +44,7 @@ global.comparePassword = async function(password, hash) {
return await bcrypt.compare(password, hash);
};
global.checkACL = function(req,, perm) {
if (!req.session.user) {
return res.status(401).render('error', { error: 'You must be logged in to access this resource.' });
}
global.checkACL = function(req, perm) {
const perms = req.session.user.perms ? JSON.parse(req.session.user.perms) : [];
if (perms.includes('*') || perms.includes(perm)) {
return true;