fix: bypass page rule check for global permission check + handle missing page extra field
This commit is contained in:
parent
68d31af7af
commit
5295e413be
@ -148,6 +148,9 @@ router.get(['/e', '/e/*'], async (req, res, next) => {
|
|||||||
await page.$relatedQuery('tags')
|
await page.$relatedQuery('tags')
|
||||||
page.tags = _.map(page.tags, 'tag')
|
page.tags = _.map(page.tags, 'tag')
|
||||||
|
|
||||||
|
// Handle missing extra field
|
||||||
|
page.extra = page.extra || { css: '', js: '' }
|
||||||
|
|
||||||
// -> Beautify Script CSS
|
// -> Beautify Script CSS
|
||||||
if (!_.isEmpty(page.extra.css)) {
|
if (!_.isEmpty(page.extra.css)) {
|
||||||
page.extra.css = new CleanCSS({ format: 'beautify' }).minify(page.extra.css).styles
|
page.extra.css = new CleanCSS({ format: 'beautify' }).minify(page.extra.css).styles
|
||||||
|
@ -226,8 +226,13 @@ module.exports = {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Skip if no page rule to check
|
||||||
|
if (!page) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
// Check Page Rules
|
// Check Page Rules
|
||||||
if (page && user.groups) {
|
if (user.groups) {
|
||||||
let checkState = {
|
let checkState = {
|
||||||
deny: false,
|
deny: false,
|
||||||
match: false,
|
match: false,
|
||||||
|
Loading…
Reference in New Issue
Block a user