auth/cell_item_actions.ts

Cell-item RPC handlers.

Four request_response actions bound to the specs in auth/cell_item_action_specs.ts:

  • cell_item_insert — admin / owner / editor-grant on parent may insert; child must be view-admitted. Returns cell_item_position_taken on (parent_id, position) unique violation; client refreshes bracket and retries.
  • cell_item_move — admin / owner / editor-grant on parent. Same collision-error shape as insert.
  • cell_item_delete — admin / owner / editor-grant on parent. Idempotent: deleted: false when no row matched.
  • cell_item_list — bidirectional. Forward (pass parent_id) is gated on can_view_cell(parent) and filters children to those the caller may view (strict target-visibility, batched). Reverse (pass child_id) has 2-layer authz: gate on can_view_cell(child), then filter rows by can_view_cell(parent).

IDOR-mask 404s on cell-miss / cell-unviewable, mirroring the existence- leak guards in auth/cell_actions.ts.

Audit events cell_item_insert / cell_item_move / cell_item_delete carry IDs only — see auth/cell_item_audit_metadata.ts.

view source

Declarations
#

3 declarations

CellItemActionDeps
#

auth/cell_item_actions.ts view source

ActionFactoryDeps import type {CellItemActionDeps} from '@fuzdev/fuz_app/auth/cell_item_actions.js';

log

Structured logger instance.

type Logger

audit

Bound audit emitter for fire-and-forget audit writes.

type AuditEmitter

create_cell_item_actions
#

to_item_json
#

auth/cell_item_actions.ts view source

(row: CellItemRow): { parent_id: string & $brand<"Uuid">; position: string & $brand<"CellItemPosition">; child_id: string & $brand<"Uuid">; created_at: string; } import {to_item_json} from '@fuzdev/fuz_app/auth/cell_item_actions.js';

row

returns

{ parent_id: string & $brand<"Uuid">; position: string & $brand<"CellItemPosition">; child_id: string & $brand<"Uuid">; created_at: string; }

Depends on
#

Imported by
#