Skip to content

Commit

Permalink
Fix not allowed user role modification by intercepting request
Browse files Browse the repository at this point in the history
  • Loading branch information
aheinze committed Feb 1, 2023
1 parent a8bc6ff commit 78d6ed3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,9 @@
# Release Notes

## WIP

- Fix not allowed user role modification by intercepting request

## 2.3.7 (2023-01-31)

- Batch update collection items state
Expand Down
5 changes: 5 additions & 0 deletions modules/System/Controller/Users.php
Expand Up @@ -82,6 +82,11 @@ public function save() {
return $this->stop(['error' => 'User data is missing'], 412);
}

// don't allow to change role if not allowed
if (isset($user['role']) && !$this->isAllowed('app/users/manage')) {
unset($user['role']);
}

$user['_modified'] = time();
$isUpdate = isset($user['_id']);

Expand Down

0 comments on commit 78d6ed3

Please sign in to comment.