Skip to content

Commit

Permalink
Prevent user from updating his own role (#2115)
Browse files Browse the repository at this point in the history
  • Loading branch information
chasebowman-contrast authored Sep 13, 2024
1 parent 269d31a commit 344ad9b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions server/api/controllers/user.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ module.exports = function UserController(gladys) {
* @apiGroup User
*/
async function updateMySelf(req, res, next) {
delete req.body.role;
const newUser = await gladys.user.update(req.user.id, req.body);
res.json(newUser);
}
Expand Down

0 comments on commit 344ad9b

Please sign in to comment.