Skip to content

Commit bc1e9e7

Browse files
committed
test(plugin-security): type the explain rls-layer accessor
Claude-Session: https://claude.ai/code/session_01Nk17Z26X5DB59iQztDBADH Co-authored-by: Claude <noreply@anthropic.com>
1 parent a078a76 commit bc1e9e7

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎packages/plugins/plugin-security/src/object-default-row-scope.test.ts‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,8 +353,12 @@ describe('[#24164 E′] the platform administrator is unchanged', () => {
353353
});
354354

355355
describe('[#24164 E′] explain names the object default, never a permission set', () => {
356-
const rlsLayer = (decision: { layers: Array<{ layer: string }> }) =>
357-
decision.layers.find((l) => l.layer === 'rls') as { verdict: string; detail: string; contributors: unknown[]; record?: any };
356+
type RlsLayer = { layer: string; verdict: string; detail: string; contributors: unknown[]; record?: any };
357+
const rlsLayer = (decision: { layers: RlsLayer[] }): RlsLayer => {
358+
const layer = decision.layers.find((l) => l.layer === 'rls');
359+
if (!layer) throw new Error('explain returned no rls layer');
360+
return layer;
361+
};
358362

359363
it('object-level: the rls layer names the default, its label and description, and the declaring object', async () => {
360364
const { security } = await boot({ baseline: false, declared: true });

0 commit comments

Comments
 (0)