Commit 49819b41 authored by NGPixel's avatar NGPixel

fix: missing write:pages perm for edit existing pages (#1228)

parent a72a7b1c
{ {
"name": "wiki", "name": "wiki",
"version": "2.0.0-beta", "version": "2.0.0",
"releaseDate": "2019-01-01T01:01:01.000Z", "releaseDate": "2019-01-01T01:01:01.000Z",
"description": "A modern, lightweight and powerful wiki app built on NodeJS, Git and Markdown", "description": "A modern, lightweight and powerful wiki app built on NodeJS, Git and Markdown",
"main": "wiki.js", "main": "wiki.js",
......
...@@ -66,7 +66,7 @@ router.get(['/e', '/e/*'], async (req, res, next) => { ...@@ -66,7 +66,7 @@ router.get(['/e', '/e/*'], async (req, res, next) => {
} }
if (page) { if (page) {
if (!WIKI.auth.checkAccess(req.user, ['manage:pages'], pageArgs)) { if (!WIKI.auth.checkAccess(req.user, ['write:pages', 'manage:pages'], pageArgs)) {
_.set(res.locals, 'pageMeta.title', 'Unauthorized') _.set(res.locals, 'pageMeta.title', 'Unauthorized')
return res.render('unauthorized', { action: 'edit' }) return res.render('unauthorized', { action: 'edit' })
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment