Simplify read-only pad ID checks

This commit is contained in:
Richard Hansen 2021-04-12 17:57:44 -04:00
parent f63610bb12
commit 329d037431
2 changed files with 3 additions and 4 deletions

View file

@ -46,8 +46,7 @@ exports.expressCreateServer = (hookName, args, cb) => {
// serve pad.html under /p
args.app.get('/p/:pad', (req, res, next) => {
// The below might break for pads being rewritten
const isReadOnly =
req.url.indexOf('/p/r.') === 0 || !webaccess.userCanModify(req.params.pad, req);
const isReadOnly = !webaccess.userCanModify(req.params.pad, req);
hooks.callAll('padInitToolbar', {
toolbar,