fix: missing guest global permissions (#788)

This commit is contained in:
Nick 2019-03-19 15:15:40 -04:00
parent dbc5efc3b3
commit 5938a20785
2 changed files with 10 additions and 9 deletions

View File

@ -11,7 +11,7 @@ const _ = require('lodash')
router.get('/robots.txt', (req, res, next) => {
res.type('text/plain')
if (_.includes(WIKI.config.seo.robots, 'noindex')) {
res.send("User-agent: *\nDisallow: /")
res.send('User-agent: *\nDisallow: /')
} else {
res.status(200).end()
}

View File

@ -353,7 +353,7 @@ module.exports = class User extends Model {
minimum: 2,
maximum: 255
}
},
}
}, { format: 'flat' })
if (validation && validation.length > 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!')
process.exit(1)
}
user.permissions = user.getGlobalPermissions()
return user
}
}