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
411802ec
Unverified
Commit
411802ec
authored
Feb 20, 2022
by
NGPixel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: check update page access using original page path
parent
3f5388d0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
pages.js
server/models/pages.js
+10
-2
No files found.
server/models/pages.js
View file @
411802ec
...
...
@@ -371,8 +371,8 @@ module.exports = class Page extends Model {
// -> Check for page access
if
(
!
WIKI
.
auth
.
checkAccess
(
opts
.
user
,
[
'write:pages'
],
{
locale
:
o
pts
.
local
e
,
path
:
o
pts
.
path
locale
:
o
gPage
.
localeCod
e
,
path
:
o
gPage
.
path
}))
{
throw
new
WIKI
.
Error
.
PageUpdateForbidden
()
}
...
...
@@ -456,6 +456,14 @@ module.exports = class Page extends Model {
// -> Perform move?
if
((
opts
.
locale
&&
opts
.
locale
!==
page
.
localeCode
)
||
(
opts
.
path
&&
opts
.
path
!==
page
.
path
))
{
// -> Check target path access
if
(
!
WIKI
.
auth
.
checkAccess
(
opts
.
user
,
[
'write:pages'
],
{
locale
:
opts
.
locale
,
path
:
opts
.
path
}))
{
throw
new
WIKI
.
Error
.
PageMoveForbidden
()
}
await
WIKI
.
models
.
pages
.
movePage
({
id
:
page
.
id
,
destinationLocale
:
opts
.
locale
,
...
...
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