Merge pull request #5508 from Zoey2936/fix-5441

Fix bug that allowed any authenticated user to modify their own roles field through the PUT
This commit is contained in:
jc21 2026-05-14 10:23:31 +10:00 committed by GitHub
commit 13cfa340de
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -87,7 +87,13 @@ const internalUser = {
}
return access
.can("users:update", data.id)
.can("users:permissions", data.id)
.catch(() => {
delete data.roles;
})
.then(() => {
return access.can("users:update", data.id);
})
.then(() => {
// Make sure that the user being updated doesn't change their email to another user that is already using it
// 1. get user we want to update