Skip to content

Commit

Permalink
Merge branch 'pu/pm/AdbContactGroupPropAclFix' into '2023.11'
Browse files Browse the repository at this point in the history
tweak(Adb Contact) contact group properties acl fix

See merge request tine20/tine20!6646
  • Loading branch information
paulmhh committed Feb 26, 2025
2 parents 80abea9 + 87e352e commit a504f2f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tine20/Addressbook/Controller/Contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
5 changes: 5 additions & 0 deletions tine20/Addressbook/Controller/List.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down

0 comments on commit a504f2f

Please sign in to comment.