Merge branch 'main' into develop
commit
8e51426567
|
@ -14,7 +14,7 @@ use Cake\Error\Debugger;
|
|||
|
||||
class EncryptionKeysController extends AppController
|
||||
{
|
||||
public $filterFields = ['owner_model', 'organisation_id', 'individual_id', 'encryption_key'];
|
||||
public $filterFields = ['owner_model', 'owner_id', 'encryption_key'];
|
||||
public $quickFilterFields = ['encryption_key'];
|
||||
public $containFields = ['Individuals', 'Organisations'];
|
||||
|
||||
|
@ -65,6 +65,13 @@ class EncryptionKeysController extends AppController
|
|||
$individualConditions = [
|
||||
'id' => $currentUser['individual_id']
|
||||
];
|
||||
} else {
|
||||
$this->loadModel('Alignments');
|
||||
$individualConditions = ['id IN' => $this->Alignments->find('list', [
|
||||
'keyField' => 'id',
|
||||
'valueField' => 'individual_id',
|
||||
'conditions' => ['organisation_id' => $currentUser['organisation_id']]
|
||||
])->toArray()];
|
||||
}
|
||||
$params['beforeSave'] = function($entity) use($currentUser) {
|
||||
if ($entity['owner_model'] === 'organisation') {
|
||||
|
|
|
@ -56,8 +56,8 @@ echo $this->element(
|
|||
'title' => __('Authentication keys')
|
||||
],
|
||||
[
|
||||
'url' => '/EncryptionKeys/index?Users.id={{0}}',
|
||||
'url_params' => ['id'],
|
||||
'url' => '/EncryptionKeys/index?owner_id={{0}}',
|
||||
'url_params' => ['individual_id'],
|
||||
'title' => __('Encryption keys')
|
||||
],
|
||||
[
|
||||
|
|
Loading…
Reference in New Issue