fix: [individual edit] permission check fix
parent
cc1839cbcf
commit
f3023eb82c
|
@ -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.'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue