fix: apply Guest modified permissions immediately

This commit is contained in:
NGPixel 2017-04-29 11:20:46 -04:00
parent 05e40b6d5c
commit 1765c9c652

View File

@ -190,6 +190,12 @@ router.post('/users/:id', (req, res) => {
} else { } else {
return usr.save() return usr.save()
} }
}).then((usr) => {
// Update guest rights for future requests
if (usr.provider === 'local' && usr.email === 'guest') {
rights.guest = usr
}
return usr
}).then(() => { }).then(() => {
return res.json({ msg: 'OK' }) return res.json({ msg: 'OK' })
}).catch((err) => { }).catch((err) => {