I am working on custom module for catalog access. It requires only logged in customer to access the assigned category products.
Right now in catalog search result, product collection displays all the category products, but I need to display only selected category products.
See below Example
Suppose customer A has access to only categories
Men > Tops > Tshirts. So, he will only see
Men > Tops > Tshirts products in catalog search in magento 2. In search results only assigned categories products should display and not any other category products.