@davoodmehraban89 / Factor-easy-2 Mirror · read-only / commits / 0e0374b
Fork 0

سامانه صدور فاکتور و حسابداری

Mirrored from https://github.com/davoodmehraban89/Factor-easy.git

Synced Dec 4, 01:45 UTC

test: require own membership visibility in tenant e2e

davoodmehraban89 committed Nov 17, 2026 at 08:57 UTC 0e0374b55f5b6840863cfd3b73825a646d7ad689
1 file changed +2
scripts/wp2-auth-tenant-e2e.mjs
+2
@@ -86,7 +86,9 @@ try {
86 const membersB = await rest('organization_members?select=organization_id,user_id', tokens[1]);
87 assert.equal(membersA.status, 200); assert.equal(membersB.status, 200);
88 const mA = await membersA.json(), mB = await membersB.json();
89 + assert.ok(mA.some(x => x.organization_id === orgA && x.user_id === users[0]));
90 assert.ok(mA.every(x => x.organization_id === orgA), 'tenant A can read foreign membership');
91 + assert.ok(mB.some(x => x.organization_id === orgB && x.user_id === users[1]));
92 assert.ok(mB.every(x => x.organization_id === orgB), 'tenant B can read foreign membership');
93 console.log('WP2_AUTH_TENANT_E2E_PASS: two Auth-issued JWTs; organization and membership RLS isolation verified through PostgREST.');
94 } finally {