Imagine we have two endpoints to get Products informations.
In this product informations we have a name and price of the product.
The first endpoint is for authenticated users and have access to the names and prices of the products.
The second one is public, and have only access to the names of the products.
What is the best pattern in this kind of situation:
Creating private handler function and public handler function separately? If yes, should I create as much as endpoints as user scope (public, private, admin…) if I want different access for each user role?
Or use the same handler function and add a parameter like IsPublic ?
I can’t find a key word to read about this.