This repository was archived by the owner on Apr 23, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Filter not working as expected #96
Copy link
Copy link
Open
Description
I have a large index of items, and would like to add an access control mechanism for items on properties of individual users. Until now I had this implemented as filters in preprocessSearchQuery(), which was working all right with Version 7.x-1.x
Now I migrated to 7.x-2.x and the filters are not working any more. They just do not get processed.
class SearchApiGroupAccess extends SearchApiAbstractProcessor {
public function preprocessSearchQuery(SearchApiQuery $query) {
$filter = $query->getFilter();
$groupFilter = $query->createFilter('OR');
$publicGroupsFilter = $query->createFilter('AND');
$publicGroupsFilter->condition('visibility', 'c');
$publicGroupsFilter->condition('privacy', 'o');
$groupFilter->filter($publicGroupsFilter);
//more filters are added ...
$filter->filter($groupFilter);
}
}
How would you solve such a scenario in the new version?
Thank you!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels