vendredi 27 juillet 2018

Querying DB records based on permissions

I have a DB table, where the user should be able to query and retrieve (using my web search form) certain records inside it. When the user does the search, he should see the records that are assigned to:

1- him directly 2- his Group 3- shared with him from other users in the system

Currently, I'm doing multiple queries in the runtime to get the records according to the previous three conditions, and it's working, but I'm worried that when the application grows, doing multiple queries and combining their results is not an efficient approach...

What could be a best practice here?

Aucun commentaire:

Enregistrer un commentaire