fix: [individual edit] permission check fix

develop-unstable
iglocska 2022-11-14 11:37:58 +01:00
parent cc1839cbcf
commit f3023eb82c
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
1 changed files with 2 additions and 2 deletions

View File

@ -81,9 +81,9 @@ class IndividualsController extends AppController
} }
$currentUser = $this->ACL->getUser(); $currentUser = $this->ACL->getUser();
$validIndividualIds = []; $validIndividualIds = [];
if ($currentUser['role']['perm_admin']) { if (!$currentUser['role']['perm_admin']) {
$validIndividualIds = $this->Individuals->getValidIndividualsToEdit($currentUser); $validIndividualIds = $this->Individuals->getValidIndividualsToEdit($currentUser);
if (!isset($validIndividualIds[$id])) { if (!in_array($id, $validIndividualIds)) {
throw new NotFoundException(__('Invalid individual.')); throw new NotFoundException(__('Invalid individual.'));
} }
} }