mirror of
https://github.com/ether/etherpad-lite.git
synced 2026-05-09 14:16:17 +02:00
padaccess: Delete useless try/catch
This commit is contained in:
parent
329d037431
commit
951d369e3f
@ -3,21 +3,16 @@ const securityManager = require('./db/SecurityManager');
|
||||
|
||||
// checks for padAccess
|
||||
module.exports = async (req, res) => {
|
||||
try {
|
||||
const {session: {user} = {}} = req;
|
||||
const accessObj = await securityManager.checkAccess(
|
||||
req.params.pad, req.cookies.sessionID, req.cookies.token, user);
|
||||
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;
|
||||
if (accessObj.accessStatus === 'grant') {
|
||||
// there is access, continue
|
||||
return true;
|
||||
} else {
|
||||
// no access
|
||||
res.status(403).send("403 - Can't touch this");
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user