I wanted to block out the products under a specific collection from others who can access the product via direct url.
So what I did was to copy main-product.liquid (Under Section) and create a new section called main-product-(collection name).
and pasted this in the top
{% if customer.tags contains ‘Your Customer Tag’ %}
and this after /section
{% else %}
{% endif %}
No sure if this is all I did , but hopefully it helps.