Expand description
Attaching the package to an application, the way every optional package attaches itself:
ⓘ
App::new()
.plugin(Rbac::from_config(db.clone(), &config)?)One explicit line in main.rs, no auto-discovery. It puts a Permissions
into the application context, which is where Can and
req.can(...) look for it — and the only reason those two work without
being handed a store.
The migrations are not registered from here, because migrations are not
runtime state: they belong in the registry the CLI generates, next to the
application’s own. Add them with registry.extend(rustlavel_rbac::migrations()).
Structs§
- Rbac
- Registers the
Permissionsstore into application state.