mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-01-22 00:07:52 +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) {
|
||||
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`)
|
||||
return res.sendStatus(403)
|
||||
} else if (user.isRoot) {
|
||||
// Root user cannot update type
|
||||
delete req.body.type
|
||||
}
|
||||
|
||||
const updatePayload = req.body
|
||||
|
Loading…
Reference in New Issue
Block a user