You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Seaography/docs/06-access-control/05-rbac.md.bak
+11-1Lines changed: 11 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -20,9 +20,19 @@ db.load_rbac().await?;
20
20
let schema = query_root::schema(db, ..)?;
21
21
```
22
22
23
+
In the GraphQL handler, you have to inject a `UserContext`:
24
+
25
+
```rust
26
+
async fn graphql_handler(..) -> Result<..> {
27
+
let mut req = req.into_inner();
28
+
req = req.data(seaography::UserContext { user_id }); // ⬅ this user id is used in RBAC
29
+
schema.execute(req).await.into()
30
+
}
31
+
```
32
+
23
33
## RBAC Editor
24
34
25
-
If you need a GUI editor to manage RBAC rules that tightly integrates with Seaography, then checkout [SeaORM Pro Plus](https://www.sea-ql.org/sea-orm-pro/docs/introduction/sea-orm-pro-plus/).
35
+
If you need a GUI editor to manage RBAC rules that tightly integrates with Seaography, then checkout [SeaORM Pro Plus](https://www.sea-ql.org/preview/pr-154/sea-orm-pro/docs/rbac/role-permissions/).
0 commit comments