我想在Hasura创建身份验证API。注册时我的用户可能具有不同的角色。考虑保持相同的枚举表。这样我就可以在用户表中使用外键/类型。但是,我打算在此枚举表上创建一个冠军触发器,以便每次添加新角色,还应创建新的Hasura角色,以允许JWT身份验证和授权。
Hasura在哪里存储其Hastrua角色。
I want to create authentication apis in Hasura. My user can have differrent roles when signing up. Thinking of maintaining an Enum table for the same. So that I can have a foreign key/type from it in the user table. However, I intend to create a postgress trigger on this enum table, such that everytime, new role is added, a new hasura role should also be created to allow for JWT authentication and authorization accordingly.
Where does hasura stores its Hasrua role.
发布评论
评论(1)
答案1(直接答案)
不确定这是应用程序开发人员应编辑的内容。
所有hasura元数据(包括角色/权限)都在Postgres中。
模式为“ HDB_CATALOG” 。该表是“ HDB_METADATA” 。
您可以使用以下查询:
它包含一个大型JSON文档。最好使用PGADMIN查看它。
答案2(动态角色)
看起来您正在尝试扮演动态角色。
有一个很棒的YouTube视频解释了如何建模:
Answer 1 (direct answer)
Not sure this is something the app developer should edit.
All Hasura metadata (including roles/permissions) is in Postgres.
The schema is "hdb_catalog". The table is "hdb_metadata".
You can query this using:
It contains a large JSON document. It's better to look at it using PGAdmin.
Answer 2 (dynamic roles)
It looks like you're trying to get dynamic roles in place.
There is a great Youtube video that explains how to model it:
https://youtu.be/-18zZO3DrLY?t=1370