Skip to content

Commit

Permalink
fix: [typo] in the authkeyscontroller
Browse files Browse the repository at this point in the history
- lead to users not being able to generate authkeys
  • Loading branch information
iglocska committed Nov 28, 2024
1 parent 467ec29 commit da4bd94
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Controller/AuthKeysController.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function add()
if (empty($currentUser['role']['perm_org_admin'])) {
$userConditions['id'] = $currentUser['id'];
} else {
$role_ids = $this->Users->Roles->find()->where(['perm_admin' => 0, 'perm_community_admin', 'perm_org_admin' => 0])->all()->extract('id')->toList();
$role_ids = $this->Users->Roles->find()->where(['perm_admin' => 0, 'perm_community_admin' => 0, 'perm_org_admin' => 0])->all()->extract('id')->toList();
$userConditions['organisation_id'] = $currentUser['organisation_id'];
$userConditions['OR'] = [
['role_id IN' => $role_ids],
Expand All @@ -84,6 +84,7 @@ public function add()
$users->where($userConditions);
}
$users = $users->order(['username' => 'asc'])->all()->toArray();

$this->CRUD->add([
'displayOnSuccess' => 'authkey_display',
'beforeSave' => function($data) use ($users) {
Expand Down

0 comments on commit da4bd94

Please sign in to comment.