From 87e352ee01566f5e69a9505384da6ed5fcce6643 Mon Sep 17 00:00:00 2001 From: Paul Mehrer Date: Wed, 26 Feb 2025 11:21:38 +0100 Subject: [PATCH] tweak(Adb Contact) contact group properties acl fix --- tine20/Addressbook/Controller/Contact.php | 7 +++++-- tine20/Addressbook/Controller/List.php | 5 +++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/tine20/Addressbook/Controller/Contact.php b/tine20/Addressbook/Controller/Contact.php index f07665965a..095ff3f4a7 100644 --- a/tine20/Addressbook/Controller/Contact.php +++ b/tine20/Addressbook/Controller/Contact.php @@ -114,9 +114,12 @@ public function get($_id, $_containerId = NULL, $_getRelatedData = TRUE, $_getDe $listController = Addressbook_Controller_List::getInstance(); $groups = $listController->getMemberships($_id); // we remove the list members, so we can do the search on the backend, its way more efficient - $contact->groups = $listController->getBackend()->search(Tinebase_Model_Filter_FilterGroup::getFilterForModel(Addressbook_Model_List::class, [ + $filter = Tinebase_Model_Filter_FilterGroup::getFilterForModel(Addressbook_Model_List::class, [ ['field' => 'id', 'operator' => 'in', 'value' => $groups] - ])); + ]); + $listController->checkFilterACL($filter); + $listController->addDefaultFilter($filter); + $contact->groups = $listController->getBackend()->search($filter); $contact->groups->members = null; } diff --git a/tine20/Addressbook/Controller/List.php b/tine20/Addressbook/Controller/List.php index d60b809a65..3cdd439aee 100644 --- a/tine20/Addressbook/Controller/List.php +++ b/tine20/Addressbook/Controller/List.php @@ -882,6 +882,11 @@ protected function _getContactIds($_userIds) return $contactIds; } + public function addDefaultFilter(Tinebase_Model_Filter_FilterGroup $_filter): void + { + $this->_addDefaultFilter($_filter); + } + /** * you can define default filters here *