sea_orm/rbac/mod.rs
1//! Role-based access control for SeaORM (`rbac` feature).
2//!
3//! Authorises connections at the SQL level: the [`RbacEngine`] reads
4//! permissions out of dedicated database tables, attaches them to a
5//! [`DatabaseConnection`](crate::DatabaseConnection) (producing a
6//! [`RestrictedConnection`](crate::RestrictedConnection)), and then every
7//! query / mutation is checked against the user's roles before being sent
8//! to the database.
9//!
10//! See the [Role Based Access Control](https://www.sea-ql.org/blog/2025-09-30-sea-orm-rbac/)
11//! blog post for an end-to-end walkthrough.
12
13#![allow(missing_docs)]
14
15mod engine;
16pub use engine::*;
17
18pub mod entity;
19pub use entity::user::UserId as RbacUserId;
20
21pub mod context;
22pub use context::*;
23
24mod error;
25pub use error::Error as RbacError;
26use error::*;
27
28pub mod schema;
29
30/// Wildcard token (`"*"`) accepted by RBAC tables to mean "any permission"
31/// or "any resource".
32pub const WILDCARD: &str = "*";
33
34pub use sea_query::audit::{AccessType, SchemaOper};