MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / assertReachReadOnly

Function assertReachReadOnly

packages/core/sdk/src/owner-policy.ts:135–145  ·  view source on GitHub ↗
(
  tableName: string,
  access: string,
  context: ExecutorOwnerPolicyContext | undefined,
)

Source from the content-addressed store, hash-verified

133 * bound behavior.
134 */
135export const assertReachReadOnly = (
136 tableName: string,
137 access: string,
138 context: ExecutorOwnerPolicyContext | undefined,
139): void => {
140 if (context === undefined) return;
141 if (context.reach !== "tenant" && context.writes !== "denied") return;
142 policyViolation(
143 `Storage ${access} on table "${tableName}" is not allowed: the platform view is read-only.`,
144 );
145};
146
147/** Assert a create/upsert writes a row inside the bound partition. */
148export const assertOwnerWritable = (

Callers 4

tenantExecutorTableFunction · 0.90
ownedExecutorTableFunction · 0.90
assertOwnerWritableFunction · 0.85
assertOwnerPatchFunction · 0.85

Calls 1

policyViolationFunction · 0.85

Tested by

no test coverage detected