Hasura角色存储在哪里?

发布于 2025-02-11 07:23:16 字数 157 浏览 3 评论 0 原文

我想在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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

演多会厌 2025-02-18 07:23:16

答案1(直接答案)

不确定这是应用程序开发人员应编辑的内容。

所有hasura元数据(包括角色/权限)都在Postgres中。

模式为“ HDB_CATALOG” 。该表是“ HDB_METADATA”

您可以使用以下查询:

SELECT * FROM "hdb_catalog"."hdb_metadata" WHERE id = 1;

它包含一个大型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:

SELECT * FROM "hdb_catalog"."hdb_metadata" WHERE id = 1;

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文