您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 

22 行
606 B

const securityManager = require('./db/SecurityManager');
// checks for padAccess
module.exports = async function (req, res) {
try {
const {session: {user} = {}} = req;
const accessObj = await securityManager.checkAccess(
req.params.pad, req.cookies.sessionID, req.cookies.token, user);
if (accessObj.accessStatus === 'grant') {
// there is access, continue
return true;
} else {
// no access
res.status(403).send("403 - Can't touch this");
return false;
}
} catch (err) {
// @TODO - send internal server error here?
throw err;
}
};