flip_api.db.seed.permissions ============================ .. py:module:: flip_api.db.seed.permissions Functions --------- .. autoapisummary:: flip_api.db.seed.permissions.seed_permissions Module Contents --------------- .. py:function:: seed_permissions(session: sqlmodel.Session) -> list[str] Seed permissions into the database, idempotently. Idempotency is keyed on the permission ``id`` (the stable :class:`PermissionRef`), not the name — matching ``seed_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. :param session: The SQLModel session used for reads and writes. :type session: Session :returns: All permission names present after seeding. :rtype: list[str]