diff --git a/tine20/Addressbook/Controller/Contact.php b/tine20/Addressbook/Controller/Contact.php index acfafe4204..f2f8b4c528 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 dcd0ba968b..138b492902 100644 --- a/tine20/Addressbook/Controller/List.php +++ b/tine20/Addressbook/Controller/List.php @@ -902,6 +902,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 *