fix: [typo] in the authkeyscontroller

- lead to users not being able to generate authkeys
pull/196/head
iglocska 2024-11-28 16:46:45 +01:00
parent 467ec29f54
commit da4bd943b7
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
1 changed files with 2 additions and 1 deletions

View File

@ -71,7 +71,7 @@ class AuthKeysController extends AppController
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],
@ -84,6 +84,7 @@ class AuthKeysController extends AppController
$users->where($userConditions);
}
$users = $users->order(['username' => 'asc'])->all()->toArray();
$this->CRUD->add([
'displayOnSuccess' => 'authkey_display',
'beforeSave' => function($data) use ($users) {