test(rls): make tenant-isolation count robust to own-company seed #310
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/PMS-414-rls-isolation-test-own-company-seed"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The rls_isolation regression hard-coded count == 1 after seeding its probe company under tenant A. PMS-413 migration 062 backfills a per-tenant internal "own company", so the default tenant A now legitimately owns two companies (own-company + probe) and the matching-GUC read returns 2 rows, failing the assertion. Both rows belong to tenant A, so RLS is not leaking - the hard-coded count was simply stale.
Capture tenant A's owner-visible company count before dropping to the unprivileged role and assert the matching-GUC read equals it. The test still proves the policy is fail-closed (zero rows with no GUC) and exposes exactly tenant A's rows under the matching GUC, but no longer breaks when seed migrations add more tenant-A-owned rows.
#PMS-414