Reputation: 328
I need to know that how we can implement dynamic role on hasura.I mean if we have lots of tables and want to have 4 access control per the table (insert, delete, update, select), a one way is that we create 4 roles for each table for example if we had two tables that named users, cars, we would have these roles:
1-add_user
2-delete_user
3-update_user
4-select_user
and
5-add_car
6-delete_car
7-update_car
8-select_car
it is not a efficient way...
please help me to find the best way.
thank you.
Upvotes: 0
Views: 145
Reputation: 24
As far as my understanding goes of roles, in your case role will just be user
. Your tables users
and cars
will have permissions assigned to user
role. So for e.g
Role
user
will have (insert, delete, update, select) permissions forusers
table but can only have (select) permission forcars
table.
For implementation, you can easily create them in permission
section of your respective table.
Let me know if this was helpful to you or if you have any furthur doubts.
Upvotes: 0