paperclipai/paperclip · error · HttpError

pipeline_write_forbidden

pipeline_write_forbidden

Error message

decision.explanation

What it means

Authorization-denied detail in assertPipelineWriteAccess: the access service's decide() call returned allowed=false for action 'pipelines:write', and decision.explanation is used verbatim as the HttpError 403 message (code from decision.code, defaulting to 'pipeline_write_forbidden'). The message content therefore comes from the access service, not this guard — it names why the actor may not write this pipeline.

Source

Thrown at server/src/routes/pipelines.ts:369

}

async function assertPipelineWriteAccess(
  req: Request,
  input: {
    access: ReturnType<typeof accessService>;
    companyId: string;
    pipelineId: string;
  },
) {
  assertPipelineCompanyAccess(req, input.companyId);
  const decision = await input.access.decide({
    actor: req.actor,
    action: "pipelines:write",
    resource: { type: "company", companyId: input.companyId },
    scope: { pipelineId: input.pipelineId },
  });
  if (!decision.allowed) {
    throw new HttpError(403, decision.explanation, {
      code: decision.code ?? "pipeline_write_forbidden",
      reason: decision.reason,
      pipelineId: input.pipelineId,
    });
  }
}

function mapPipelineDocumentRevision(row: {
  id: string;
  companyId: string;
  documentId: string;
  pipelineId: string;
  key: string;
  revisionNumber: number;
  title: string | null;
  format: string;
  body: string;
  changeSummary: string | null;

View on GitHub (pinned to 01ad858492)

Solutions

  1. Provide decision.explanation in the request body as required by this endpoint.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at server/src/routes/pipelines.ts:484 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of paperclipai/paperclip@01ad858492 (2026-08-18). Data as JSON: /api/errors/121117a9d422e5de. Report an issue: GitHub.