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
0d2aa56b
Unverified
Commit
0d2aa56b
authored
May 02, 2019
by
Nicolas Giard
Committed by
GitHub
May 02, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: view page as unauthorized user
parent
8970e703
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
4 deletions
+2
-4
common.js
server/controllers/common.js
+2
-4
No files found.
server/controllers/common.js
View file @
0d2aa56b
...
...
@@ -136,10 +136,8 @@ router.get('/*', async (req, res, next) => {
const
pageArgs
=
pageHelper
.
parsePath
(
req
.
path
)
if
(
!
WIKI
.
auth
.
checkAccess
(
req
.
user
,
[
'read:pages'
],
pageArgs
))
{
if
(
pageArgs
.
path
===
'home'
)
{
_
.
set
(
res
.
locals
,
'pageMeta.title'
,
'Unauthorized'
)
return
res
.
render
(
'unauthorized'
,
{
action
:
'view'
})
}
_
.
set
(
res
.
locals
,
'pageMeta.title'
,
'Unauthorized'
)
return
res
.
render
(
'unauthorized'
,
{
action
:
'view'
})
}
const
page
=
await
WIKI
.
models
.
pages
.
getPage
({
...
...
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