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
5295e413
Commit
5295e413
authored
Sep 09, 2020
by
NGPixel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: bypass page rule check for global permission check + handle missing page extra field
parent
68d31af7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
common.js
server/controllers/common.js
+3
-0
auth.js
server/core/auth.js
+6
-1
No files found.
server/controllers/common.js
View file @
5295e413
...
...
@@ -148,6 +148,9 @@ router.get(['/e', '/e/*'], async (req, res, next) => {
await
page
.
$relatedQuery
(
'tags'
)
page
.
tags
=
_
.
map
(
page
.
tags
,
'tag'
)
// Handle missing extra field
page
.
extra
=
page
.
extra
||
{
css
:
''
,
js
:
''
}
// -> Beautify Script CSS
if
(
!
_
.
isEmpty
(
page
.
extra
.
css
))
{
page
.
extra
.
css
=
new
CleanCSS
({
format
:
'beautify'
}).
minify
(
page
.
extra
.
css
).
styles
...
...
server/core/auth.js
View file @
5295e413
...
...
@@ -226,8 +226,13 @@ module.exports = {
return
false
}
// Skip if no page rule to check
if
(
!
page
)
{
return
true
}
// Check Page Rules
if
(
page
&&
user
.
groups
)
{
if
(
user
.
groups
)
{
let
checkState
=
{
deny
:
false
,
match
:
false
,
...
...
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