fix: missing guest global permissions (#788)
This commit is contained in:
parent
dbc5efc3b3
commit
5938a20785
@ -11,7 +11,7 @@ const _ = require('lodash')
|
|||||||
router.get('/robots.txt', (req, res, next) => {
|
router.get('/robots.txt', (req, res, next) => {
|
||||||
res.type('text/plain')
|
res.type('text/plain')
|
||||||
if (_.includes(WIKI.config.seo.robots, 'noindex')) {
|
if (_.includes(WIKI.config.seo.robots, 'noindex')) {
|
||||||
res.send("User-agent: *\nDisallow: /")
|
res.send('User-agent: *\nDisallow: /')
|
||||||
} else {
|
} else {
|
||||||
res.status(200).end()
|
res.status(200).end()
|
||||||
}
|
}
|
||||||
|
@ -353,7 +353,7 @@ module.exports = class User extends Model {
|
|||||||
minimum: 2,
|
minimum: 2,
|
||||||
maximum: 255
|
maximum: 255
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
}, { format: 'flat' })
|
}, { format: 'flat' })
|
||||||
if (validation && validation.length > 0) {
|
if (validation && validation.length > 0) {
|
||||||
throw new WIKI.Error.InputInvalid(validation[0])
|
throw new WIKI.Error.InputInvalid(validation[0])
|
||||||
@ -422,6 +422,7 @@ module.exports = class User extends Model {
|
|||||||
WIKI.logger.error('CRITICAL ERROR: Guest user is missing!')
|
WIKI.logger.error('CRITICAL ERROR: Guest user is missing!')
|
||||||
process.exit(1)
|
process.exit(1)
|
||||||
}
|
}
|
||||||
|
user.permissions = user.getGlobalPermissions()
|
||||||
return user
|
return user
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user