0

user profile table have a name, phoneNumber , isPrivate and additional attributes, If user check isPrivate to true, then if other users return any data related to this user the response shouldn't have the name and phoneNumber except the admin and the user himself, another problem is responses are different in structure and user object may be on level one or on another level at response how can I achieve such behaviour?

Tech: (nodejs , sequelize , postgress)

  • Maybe scopes do that trick for you. – Anatoly Sep 18 '22 at 16:27
  • The SO community will help with your issues, but there are certain expectations on you. Please take a few minuets to take the [Tour](https://stackoverflow.com/tour) and review [ask]. Then update your question to include sample data, table definition (ddl scripts), the expected results of that data and what you have tried, all as text - **no images**. Further describe what you mean *different in structure* and *level*. Finally how to determine if the requesting user is an admin. – Belayer Sep 18 '22 at 17:22

0 Answers0