Owner-only database statements route to the owner role

OrionGIS web 1.61.2Released 10 November 2026

The database layer now sends every owner-only statement (table creation, alters, indexes) to the owner role no matter which connection the caller used, so the non-owner app role can be enabled without breaking the self-creating tables.

Changes since 1.61.1.

#Fixed

  • Self-creating tables would fail under the non-owner app role. With the least-privilege orion_app database role enabled (the last step of the tenant-isolation hardening), modules that create their own tables on first use — telemetry, lifecycle emails, service tokens, billing, suspensions, notifications and others — were still running those create-table statements on the app role, which owns nothing and cannot create tables. Every owner-only statement is now routed to the owner connection by the database layer itself, whatever pool the caller used, so the app role can be turned on without breaking these tables. Temporary tables are deliberately left on the caller's own connection.
  • The app-role provisioning script could silently skip its grants. When run without a terminal (CI, agent shells), the script's grant step could receive no input and still report success. The grants now run as one explicit command, and the script verifies they took effect before printing its instructions.

#Infrastructure

  • New negative test scripts/ddl-routing-test.ts (run against a throwaway database) proves: owner-only statements reach the owner pool from both the plain query path and inside explicit transactions, ordinary reads and writes stay on the app role, temp tables stay session-local, and the app role alone still cannot create tables.