Skip to main content

init

Function init 

Source
pub async fn init(abilities: Vec<Ability>) -> Result<(), StorageError>
Expand description

Seed the abilities into the DB if the permission table is empty, load all grants into the cache, and register the authorizer with adminx-core. Call after storage is set (and, on SQL, after running migrate_sql).

Idempotent-ish: seeding only happens when the table is empty, so restarts and panel edits are preserved — the database is authoritative once populated.