From 39c848202ab696259e2f8933847c3ccefb7a529b Mon Sep 17 00:00:00 2001 From: mokaddem Date: Tue, 29 Jun 2021 11:26:06 +0200 Subject: [PATCH 1/2] chg: [users:index] Allow quick filters --- src/Controller/UsersController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Controller/UsersController.php b/src/Controller/UsersController.php index 9126e87..9df380f 100644 --- a/src/Controller/UsersController.php +++ b/src/Controller/UsersController.php @@ -13,7 +13,8 @@ class UsersController extends AppController { $this->CRUD->index([ 'contain' => ['Individuals', 'Roles'], - 'filters' => ['Users.email', 'uuid'] + 'filters' => ['Users.email', 'uuid'], + 'quickFilters' => ['uuid', ['username' => true], ['Individuals.first_name' => true], ['Individuals.last_name' => true], 'Individuals.email'], ]); if ($this->ParamHandler->isRest()) { return $this->restResponsePayload; From bb70a58885571c5fd9a5e7cfcc28b3263044da1f Mon Sep 17 00:00:00 2001 From: iglocska Date: Tue, 29 Jun 2021 11:51:29 +0200 Subject: [PATCH 2/2] fix: [ACL] fixed checks for multiple values --- src/Controller/Component/ACLComponent.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Controller/Component/ACLComponent.php b/src/Controller/Component/ACLComponent.php index 6fd0556..ead5a48 100644 --- a/src/Controller/Component/ACLComponent.php +++ b/src/Controller/Component/ACLComponent.php @@ -68,11 +68,11 @@ class ACLComponent extends Component 'index' => ['*'] ], 'Inbox' => [ - 'createEntry' => ['perm_admin', 'perm_sync'], + 'createEntry' => ['OR' => ['perm_admin', 'perm_sync']], 'delete' => ['perm_admin'], 'filtering' => ['perm_admin'], 'index' => ['perm_admin'], - 'listProcessors' => ['perm_admin', 'perm_sync'], + 'listProcessors' => ['OR' => ['perm_admin', 'perm_sync']], 'process' => ['perm_admin'], 'view' => ['perm_admin'], ], @@ -274,14 +274,14 @@ class ACLComponent extends Component } if (isset($this->aclList[$controller][$action]['OR'])) { foreach ($this->aclList[$controller][$action]['OR'] as $permission) { - if ($user['Role'][$permission]) { + if ($this->user['role'][$permission]) { return true; } } } elseif (isset($this->aclList[$controller][$action]['AND'])) { $allConditionsMet = true; foreach ($this->aclList[$controller][$action]['AND'] as $permission) { - if (!$user['Role'][$permission]) { + if (!$this->user['role'][$permission]) { $allConditionsMet = false; } }