Replies: 1 comment 5 replies
-
Hello @csennitt In Hasura, you can use the built-in "role" feature to restrict access to certain rows of data based on the user's role. To restrict a user to only see the data they have entered, you would create a new role for that user, and then define a rule that only allows them to access rows where a certain column (e.g. "customer_id") matches their user ID. Here is an example of how you might set this up:
Respectively, in permissions for that table, under |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Can Hasura handle each user only being able to see only the set of data they enter ?
I have a Practice table with an id,
a customer table with id and also practice id ( from above )
a visit table with customer id ( from above )
when a practice person logs in ( with JWT token ) how can do I ensure they can only see their own customers, visits and another other related data ( notes etc ).
I do not want practice id=2, too be able to see data from practice id=1 related data.
so practice id=1 has related multiple customers, each customer has multiple visits. It is important that none of the customers and related visits/notes "owned" by practice 1 are accessible by practice 2.
do i need to add "practice_id" to each table and filter on them ( somehow ) ?
Beta Was this translation helpful? Give feedback.
All reactions