Restricting access to product detail pages but not on category pages

Is there a way to restrict users to only the product detail page and not the category listing? I know you can restrict products, but that takes them off of the category pages as well. I would like for those products to still show up on the category listing, and just 404 people when they click to get to the details (I have a custom 404).

What criteria determines who can see the detail and who can’t?

If they are logged in they can see the detail, otherwise they cannot.

Normally, people simply want to restrict viewing pricing and the ability to add the product to the cart if they’re not logged in. Haven’t ever seen a request to completly prevent them from seeing product details…

Sorry, no idea how to do what you want.