Skip to main content
5 of 6
edited tags
Matoeil
  • 3.5k
  • 4
  • 31
  • 57

Building a search View that respects access control

I'm implementing search on a site using taxonomy access control with search api and search api solr. Reading the help page node access section, I see:

Needs details on how to build a View that respects access control.

… which is exactly what I need. How can I make a search view properly respect the taxonomy access control? I've got node access turned on in the index settings, and see the field available in the views filter, so I see some items with node_access_taxonomy_access_role:n set up, I could try to filter on this, but it would not affect the facets.

I have

Additional access checks on result entities

turned on in query settings as a temporary measure, but that only filters the search results, and not any facets, etc.

One possible (though inefficient) solution seems like it could be to make two indexes and the have two displays in the search view, searching the right index depending on whether the user is authenticated or not, but I see no good way to limit the index based on the taxonomy term assigned.

It seems like my question extends beyond the boundaries of the search view, and onto the index itself.

UltraBob
  • 1.3k
  • 9
  • 37