Commit 7e86273e authored by Quentin Ribac's avatar Quentin Ribac
Browse files

FEAT #17436 TIME 0:15 prioritize group managers over user managers

parent 02d5687b
......@@ -90,10 +90,10 @@ class PrivilegeController
if (empty($args['readOnly']) && !isset($args['parameters']['authorized'])) {
return false;
}
if (!PrivilegeController::hasPrivilege(['userId' => $args['userId'], 'privilege' => 'manage_users'])) {
return false;
} elseif (PrivilegeController::hasPrivilege(['userId' => $args['userId'], 'privilege' => 'manage_groups'])) {
if (PrivilegeController::hasPrivilege(['userId' => $args['userId'], 'privilege' => 'manage_groups'])) {
return true;
} elseif (!PrivilegeController::hasPrivilege(['userId' => $args['userId'], 'privilege' => 'manage_users'])) {
return false;
} else {
$candidateGroups = $args['parameters']['authorized'] ?? [];
$manageableGroups = array_column(UserController::getManageableGroups(['userId' => $args['userId']]), 'id');
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment