Commit 4f16dd0c authored by NGPixel's avatar NGPixel

fix: admin permissions + restrict nav settings

parent 10f17c57
...@@ -36,6 +36,20 @@ router.get('/healthz', (req, res, next) => { ...@@ -36,6 +36,20 @@ router.get('/healthz', (req, res, next) => {
* Administration * Administration
*/ */
router.get(['/a', '/a/*'], (req, res, next) => { router.get(['/a', '/a/*'], (req, res, next) => {
if (!WIKI.auth.checkAccess(req.user, [
'manage:system',
'write:users',
'manage:users',
'write:groups',
'manage:groups',
'manage:navigation',
'manage:theme',
'manage:api'
])) {
_.set(res.locals, 'pageMeta.title', 'Unauthorized')
return res.render('unauthorized', { action: 'view' })
}
_.set(res.locals, 'pageMeta.title', 'Admin') _.set(res.locals, 'pageMeta.title', 'Admin')
res.render('admin') res.render('admin')
}) })
......
...@@ -15,8 +15,8 @@ extend type Mutation { ...@@ -15,8 +15,8 @@ extend type Mutation {
# ----------------------------------------------- # -----------------------------------------------
type NavigationQuery { type NavigationQuery {
tree: [NavigationTree]! tree: [NavigationTree]! @auth(requires: ["manage:navigation", "manage:system"])
config: NavigationConfig! config: NavigationConfig! @auth(requires: ["manage:navigation", "manage:system"])
} }
# ----------------------------------------------- # -----------------------------------------------
......
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