testing/cross_backend/cell_grant_role.ts view source
"cell_editor" import {CELL_EDITOR_ROLE} from '@fuzdev/fuz_app/testing/cross_backend/cell_grant_role.js'; App role the holder is seeded with; matches the spine's registered role.
Cross-backend parity suite for role-shaped cell_grants.
The cell CRUD / relations suites exercise only actor-shaped grant principals. This suite covers the role-shaped path and its closed-registry gate — the security-correctness property that the Rust spine previously lacked (it created inert grant rows for any role string). Both spines now validate the role against a closed registry at create.
{role} on a private cell; an account holding that role can cell_get
it (200), an account without it gets the IDOR-mask 404.invalid_params / cell_grant_unknown_role,
not a silent inert row.editor-level
role grant can cell_update the cell's content.The holder is seeded via extra_accounts under CELL_ROLE_HOLDER_USERNAME
holding the suite's role — CELL_EDITOR_ROLE by default, which has no
grant path, so it can't be offered and the bootstrap-cradle seed is the only
path. Both legs configure that seed and register CELL_EDITOR_ROLE in their
role registry; the same membership is in the Rust stub's RoleRegistry
(which the cell spec set also reads). A backend with only the builtin roles passes ROLE_KEEPER
(no admin reach, so every arm still turns on the grant); ROLE_ADMIN is
refused, since an admin reaches every cell whatever its grants.
Cites security.md §Authorization (role-shaped cell-grant validation).
Runs both legs via the shared {setup_test} protocol: in-process
(auth/cell_grant_role_parity.db.test.ts) + cross-process
(cross_backend/spine_suites.cross.test.ts). Gated on
capabilities.cell_relations (true on the in-process app and fuz_app's
spine presets; a consumer states it like every MountFlag).
4 declarations
testing/cross_backend/cell_grant_role.ts view source
"cell_editor" import {CELL_EDITOR_ROLE} from '@fuzdev/fuz_app/testing/cross_backend/cell_grant_role.js'; App role the holder is seeded with; matches the spine's registered role.
testing/cross_backend/cell_grant_role.ts view source
"cell_role_holder" import {CELL_ROLE_HOLDER_USERNAME} from '@fuzdev/fuz_app/testing/cross_backend/cell_grant_role.js'; Username the fixture seeds (via extra_accounts) holding the suite's role.
testing/cross_backend/cell_grant_role.ts view source
CellGrantRoleCrossTestOptions import type {CellGrantRoleCrossTestOptions} from '@fuzdev/fuz_app/testing/cross_backend/cell_grant_role.js'; Options for describe_cell_grant_role_cross_tests.
role?The role the grants name, which the CELL_ROLE_HOLDER_USERNAME account the setup seeds must hold and the backend's cell role registry must know. Default CELL_EDITOR_ROLE. It must not be ROLE_ADMIN: a global admin views and edits every cell, so the holder arms would pass without the grant — the call throws. ROLE_KEEPER serves a backend with only the builtin roles, since keeper reach is not admin reach.
type string
testing/cross_backend/cell_grant_role.ts view source
(options: CellGrantRoleCrossTestOptions): void import {describe_cell_grant_role_cross_tests} from '@fuzdev/fuz_app/testing/cross_backend/cell_grant_role.js'; optionsvoid