flip_api.db.seed.permissions
Functions
|
Seed permissions into the database, idempotently. |
Module Contents
- flip_api.db.seed.permissions.seed_permissions(session: sqlmodel.Session) list[str]
Seed permissions into the database, idempotently.
Idempotency is keyed on the permission
id(the stablePermissionRef), not the name — matchingseed_roles: a permission may be renamed while keeping its id, so a name-keyed check would miss the existing row and collide on the primary key when re-seeding a live database. An existing permission has its name/description refreshed in place so renames apply.- Parameters:
session (Session) – The SQLModel session used for reads and writes.
- Returns:
All permission names present after seeding.
- Return type:
list[str]