mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-03-19 00:18:34 +01:00
Fix:Updating root user #3366
This commit is contained in:
parent
f194c5be0e
commit
60e348fcc1
@ -205,9 +205,12 @@ class UserController {
|
|||||||
async update(req, res) {
|
async update(req, res) {
|
||||||
const user = req.reqUser
|
const user = req.reqUser
|
||||||
|
|
||||||
if (user.type === 'root' && !req.user.isRoot) {
|
if (user.isRoot && !req.user.isRoot) {
|
||||||
Logger.error(`[UserController] Admin user "${req.user.username}" attempted to update root user`)
|
Logger.error(`[UserController] Admin user "${req.user.username}" attempted to update root user`)
|
||||||
return res.sendStatus(403)
|
return res.sendStatus(403)
|
||||||
|
} else if (user.isRoot) {
|
||||||
|
// Root user cannot update type
|
||||||
|
delete req.body.type
|
||||||
}
|
}
|
||||||
|
|
||||||
const updatePayload = req.body
|
const updatePayload = req.body
|
||||||
|
Loading…
Reference in New Issue
Block a user