Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wiki-js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
wiki-js
Commits
4f16dd0c
Commit
4f16dd0c
authored
Jul 19, 2020
by
NGPixel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: admin permissions + restrict nav settings
parent
10f17c57
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
2 deletions
+16
-2
common.js
server/controllers/common.js
+14
-0
navigation.graphql
server/graph/schemas/navigation.graphql
+2
-2
No files found.
server/controllers/common.js
View file @
4f16dd0c
...
...
@@ -36,6 +36,20 @@ router.get('/healthz', (req, res, next) => {
* Administration
*/
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'
)
res
.
render
(
'admin'
)
})
...
...
server/graph/schemas/navigation.graphql
View file @
4f16dd0c
...
...
@@ -15,8 +15,8 @@ extend type Mutation {
# -----------------------------------------------
type
NavigationQuery
{
tree
:
[
NavigationTree
]!
config
:
NavigationConfig
!
tree
:
[
NavigationTree
]!
@
auth
(
requires
:
[
"
manage
:
navigation
"
,
"
manage
:
system
"
])
config
:
NavigationConfig
!
@
auth
(
requires
:
[
"
manage
:
navigation
"
,
"
manage
:
system
"
])
}
# -----------------------------------------------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment