Skip to content

Commit 75a7c44

Browse files
committed
test(plugin-security): the rule's peer carries an expired ban, so the rule is what answers it
A non-system write now meets the reference check, and with it the ban check, before the record's validation rules; the control's peer keeps `banned` true for the rule to read, with a ban no longer in force. Claude-Session: https://claude.ai/code/session_01Utp6CYQjMkN514R78sCrTT Co-authored-by: Claude <noreply@anthropic.com>
1 parent 93fce6c commit 75a7c44

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎packages/plugins/plugin-security/src/predicate-related-read-tenant-scope.test.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,11 @@ async function boot(kind: 'secret' | 'public', posture?: 'single' | 'group' | 'i
168168
{ id: 'line_y', kind, organization_id: 'org_y' },
169169
]);
170170
// The caller u_x and its peer u_x2 (org X); u_y belongs to org Y only.
171+
// [#30205] u_x2's ban has expired: `banned` still reads true, which is what
172+
// the rule reads, and the write's ban check (a ban in force) leaves it be.
171173
await table('sys_user').insert([
172174
{ id: 'u_x', name: 'X', email: 'x@x.test', banned: false },
173-
{ id: 'u_x2', name: 'X2', email: 'x2@x.test', banned: true },
175+
{ id: 'u_x2', name: 'X2', email: 'x2@x.test', banned: true, ban_expires: '2020-01-01T00:00:00.000Z' },
174176
{ id: 'u_y', name: 'Y', email: 'y@y.test', banned: kind === 'secret' },
175177
]);
176178

0 commit comments

Comments
 (0)