mirror of
https://github.com/ether/etherpad-lite.git
synced 2026-01-23 18:55:21 +00:00
This will be a breaking change for some people. We removed all internal password control logic. If this affects you, you have two options: 1. Use a plugin for authentication and use session based pad access (recommended). 1. Use a plugin for password setting. The reasoning for removing this feature is to reduce the overall security footprint of Etherpad. It is unnecessary and cumbersome to keep this feature and with the thousands of available authentication methods available in the world our focus should be on supporting those and allowing more granual access based on their implementations (instead of half assed baking our own).
22 lines
603 B
JavaScript
22 lines
603 B
JavaScript
var 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;
|
|
}
|
|
}
|