mirror of
https://github.com/warmbly/warmbly.git
synced 2026-09-11 16:08:09 +00:00
Add two new admin permission bits — view_organizations (bit 20) and manage_organizations (bit 21) — and switch the existing read-only /admin/organizations routes off the borrowed AdminPermViewUsers bit they were using as a placeholder. Backfill the three predefined roles (support, ops, analyst) with view_organizations so existing role mappings still resolve cleanly; super continues to pick up everything via AllAdminPermissions. Migration 000044 adds organization_limit_overrides, the table the next commit's write path will target. Schema follows the "0 = inherit from plan" convention from the design discussion: each numeric column defaults to 0 and a CHECK constraint enforces non-negative values, so reverting an override is a write of 0 (preserving the granted_by audit trail) rather than a DELETE. Bumping the permission count changes every role's numeric bitmask, so update the make grant-admin role table to match — super is now 4194303, support 1086401, ops 1062960, analyst 1055233.