mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 23:46:14 -04:00
security: Check authentication in SecurityManager checkAccess
In addition to providing defense in depth, this change makes it easier to implement future enhancements such as support for read-only users.
This commit is contained in:
parent
259b8d891d
commit
f9087fabd6
5 changed files with 22 additions and 6 deletions
|
@ -3,7 +3,9 @@ var securityManager = require('./db/SecurityManager');
|
|||
// checks for padAccess
|
||||
module.exports = async function (req, res) {
|
||||
try {
|
||||
let accessObj = await securityManager.checkAccess(req.params.pad, req.cookies.sessionID, req.cookies.token, req.cookies.password);
|
||||
const {session: {user} = {}} = req;
|
||||
const accessObj = await securityManager.checkAccess(
|
||||
req.params.pad, req.cookies.sessionID, req.cookies.token, req.cookies.password, user);
|
||||
|
||||
if (accessObj.accessStatus === "grant") {
|
||||
// there is access, continue
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue