auth/cell_grant_action_specs.ts

Cell-grant ACL RPC specs — declarative contract for the three cell_grant_* verbs (create, revoke, list).

The grant primitive is a resource-side ACL: each row admits a principal (actor or role+scope) at a level (viewer / editor) on a single cell. Owner is implicit on cell.created_by and never appears in the grant list.

Principal is {actor_id} or {role, scope_id?} — no name resolver on this verb. Callers pick an actor by id via actor_search (debounced prefix search) and submit the resolved id directly.

view source

Declarations
#

16 declarations

all_cell_grant_action_specs
#

auth/cell_grant_action_specs.ts view source

readonly [{ method: string; kind: "request_response"; initiator: "frontend"; auth: { account: "required"; actor: "required"; }; side_effects: true; input: ZodObject<{ cell_id: $ZodBranded<ZodUUID, "Uuid", "out">; level: ZodEnum<...>; principal: ZodDiscriminatedUnion<...>; acting: ZodOptional<...>; }, $strict>; outpu... import {all_cell_grant_action_specs} from '@fuzdev/fuz_app/auth/cell_grant_action_specs.js';

All cell_grant action specs — composed into all_cell_action_specs.

cell_grant_create_action_spec
#

auth/cell_grant_action_specs.ts view source

also exported from auth/cell_action_specs.ts

{ method: string; kind: "request_response"; initiator: "frontend"; auth: { account: "required"; actor: "required"; }; side_effects: true; input: ZodObject<{ cell_id: $ZodBranded<ZodUUID, "Uuid", "out">; level: ZodEnum<...>; principal: ZodDiscriminatedUnion<...>; acting: ZodOptional<...>; }, $strict>; output: ZodObje... import {cell_grant_create_action_spec} from '@fuzdev/fuz_app/auth/cell_grant_action_specs.js';

cell_grant_list_action_spec
#

auth/cell_grant_action_specs.ts view source

also exported from auth/cell_action_specs.ts

{ method: string; kind: "request_response"; initiator: "frontend"; auth: { account: "required"; actor: "required"; }; side_effects: false; input: ZodObject<{ cell_id: $ZodBranded<ZodUUID, "Uuid", "out">; acting: ZodOptional<...>; }, $strict>; output: ZodObject<...>; async: true; description: string; } import {cell_grant_list_action_spec} from '@fuzdev/fuz_app/auth/cell_grant_action_specs.js';

cell_grant_revoke_action_spec
#

auth/cell_grant_action_specs.ts view source

also exported from auth/cell_action_specs.ts

{ method: string; kind: "request_response"; initiator: "frontend"; auth: { account: "required"; actor: "required"; }; side_effects: true; input: ZodObject<{ grant_id: $ZodBranded<ZodUUID, "Uuid", "out">; acting: ZodOptional<...>; }, $strict>; output: ZodObject<...>; async: true; description: string; } import {cell_grant_revoke_action_spec} from '@fuzdev/fuz_app/auth/cell_grant_action_specs.js';

CellGrantCreateInput
#

auth/cell_grant_action_specs.ts view source

ZodObject<{ cell_id: $ZodBranded<ZodUUID, "Uuid", "out">; level: ZodEnum<{ viewer: "viewer"; editor: "editor"; }>; principal: ZodDiscriminatedUnion<[ZodObject<{ kind: ZodLiteral<"actor">; actor_id: $ZodBranded<...>; }, $strict>, ZodObject<...>], "kind">; acting: ZodOptional<...>; }, $strict> import type {CellGrantCreateInput} from '@fuzdev/fuz_app/auth/cell_grant_action_specs.js';

Input for cell_grant_create. Idempotent on the unique index — re-granting the same (cell_id, principal) pair updates level + granted_by rather than producing a duplicate row.

CellGrantCreateOutput
#

auth/cell_grant_action_specs.ts view source

ZodObject<{ grant: ZodObject<{ id: $ZodBranded<ZodUUID, "Uuid", "out">; cell_id: $ZodBranded<ZodUUID, "Uuid", "out">; level: ZodEnum<{ viewer: "viewer"; editor: "editor"; }>; ... 4 more ...; created_at: ZodString; }, $strict>; }, $strict> import type {CellGrantCreateOutput} from '@fuzdev/fuz_app/auth/cell_grant_action_specs.js';

CellGrantLevel
#

auth/cell_grant_action_specs.ts view source

ZodEnum<{ viewer: "viewer"; editor: "editor"; }> import type {CellGrantLevel} from '@fuzdev/fuz_app/auth/cell_grant_action_specs.js';

Grant level — view-only or view-plus-edit.

CellGrantListInput
#

auth/cell_grant_action_specs.ts view source

ZodObject<{ cell_id: $ZodBranded<ZodUUID, "Uuid", "out">; acting: ZodOptional<$ZodBranded<ZodUUID, "Uuid", "out">>; }, $strict> import type {CellGrantListInput} from '@fuzdev/fuz_app/auth/cell_grant_action_specs.js';

CellGrantListOutput
#

auth/cell_grant_action_specs.ts view source

ZodObject<{ grants: ZodArray<ZodObject<{ id: $ZodBranded<ZodUUID, "Uuid", "out">; cell_id: $ZodBranded<ZodUUID, "Uuid", "out">; level: ZodEnum<{ viewer: "viewer"; editor: "editor"; }>; ... 4 more ...; created_at: ZodString; }, $strict>>; }, $strict> import type {CellGrantListOutput} from '@fuzdev/fuz_app/auth/cell_grant_action_specs.js';

CellGrantPrincipalInput
#

auth/cell_grant_action_specs.ts view source

ZodDiscriminatedUnion<[ZodObject<{ kind: ZodLiteral<"actor">; actor_id: $ZodBranded<ZodUUID, "Uuid", "out">; }, $strict>, ZodObject<{ kind: ZodLiteral<"role">; role: ZodString; scope_id: ZodOptional<...>; }, $strict>], "kind"> import type {CellGrantPrincipalInput} from '@fuzdev/fuz_app/auth/cell_grant_action_specs.js';

Wire-input principal. Discriminated by kind. Actor-shaped principals carry a resolved actor_id — the picker UI runs actor_search to convert a typed name to an id before this verb is called.

CellGrantRevokeInput
#

auth/cell_grant_action_specs.ts view source

ZodObject<{ grant_id: $ZodBranded<ZodUUID, "Uuid", "out">; acting: ZodOptional<$ZodBranded<ZodUUID, "Uuid", "out">>; }, $strict> import type {CellGrantRevokeInput} from '@fuzdev/fuz_app/auth/cell_grant_action_specs.js';

CellGrantRevokeOutput
#

auth/cell_grant_action_specs.ts view source

ZodObject<{ ok: ZodLiteral<true>; still_admitted: ZodBoolean; }, $strict> import type {CellGrantRevokeOutput} from '@fuzdev/fuz_app/auth/cell_grant_action_specs.js';

Output for cell_grant_revoke. still_admitted is true when the caller retains some admit path on the cell after the revoke (other grant, ownership, admin). Always true for non-self revokes (the caller didn't admit via this row to begin with).

ERROR_CELL_GRANT_NOT_FOUND
#

auth/cell_grant_action_specs.ts view source

"cell_grant_not_found" import {ERROR_CELL_GRANT_NOT_FOUND} from '@fuzdev/fuz_app/auth/cell_grant_action_specs.js';

Error reason — grant id did not resolve, or caller may not see it.

ERROR_CELL_GRANT_PRINCIPAL_IS_OWNER
#

auth/cell_grant_action_specs.ts view source

"cell_grant_principal_is_owner" import {ERROR_CELL_GRANT_PRINCIPAL_IS_OWNER} from '@fuzdev/fuz_app/auth/cell_grant_action_specs.js';

Error reason — cell_grant_create principal resolves to the cell's owner. Owner access is implicit (cell.created_by); a self-grant row would shadow it without changing access and create a confusing self-leave path.

ERROR_CELL_GRANT_UNKNOWN_ROLE
#

auth/cell_grant_action_specs.ts view source

"cell_grant_unknown_role" import {ERROR_CELL_GRANT_UNKNOWN_ROLE} from '@fuzdev/fuz_app/auth/cell_grant_action_specs.js';

Error reason — role-shaped principal references a role string not registered in the role schema. Would produce a dead grant row that no role_grant could match.

GrantJson
#

auth/cell_grant_action_specs.ts view source

ZodObject<{ id: $ZodBranded<ZodUUID, "Uuid", "out">; cell_id: $ZodBranded<ZodUUID, "Uuid", "out">; level: ZodEnum<{ viewer: "viewer"; editor: "editor"; }>; ... 4 more ...; created_at: ZodString; }, $strict> import type {GrantJson} from '@fuzdev/fuz_app/auth/cell_grant_action_specs.js';

Wire-format for a cell_grant row. Mirrors CellJson's shape — ISO-string created_at, branded UUIDs, principal columns surfaced as-is. Caller inspects actor_id xor role to render the right principal label.

Depends on
#

Imported by
#