nexu-io/open-design · error · AutomationWorkspaceScopeError

WORKSPACE_PROJECT_PERMISSION_DENIED

WORKSPACE_PROJECT_PERMISSION_DENIED

Error message

the reused project Workspace is no longer writable by this member

What it means

Thrown by authorizePersistedProjectWorkspace with code WORKSPACE_PROJECT_PERMISSION_DENIED and retryable=false. Same shape as error 27 but for the reused-project binding path: it looks the workspaceId up in the directory and requires activeWritableContext to succeed. The separate code lets callers branch project-reuse denials apart from automation-scope denials.

Source

Thrown at apps/daemon/src/automations/workspace-scope.ts:157

    );
  }
  return context;
}

/**
 * Resolve a reused project's persisted binding. The project row chooses the
 * Workspace; the signed-in directory supplies the current member and authority.
 */
export async function authorizePersistedProjectWorkspace(
  workspaceIdInput: string,
  fetchWorkspaceDirectory: (() => Promise<WorkspaceDirectoryFetchResult>) | undefined,
): Promise<WorkspaceCollabContext> {
  const workspaceId = workspaceIdInput.trim();
  const items = await fetchDirectoryOrThrow(fetchWorkspaceDirectory);
  const item = items.find((candidate) => candidate.workspaceId === workspaceId);
  const context = activeWritableContext(item ? workspaceContextFromDirectoryItem(item) : null);
  if (!context) {
    throw new AutomationWorkspaceScopeError(
      'WORKSPACE_PROJECT_PERMISSION_DENIED',
      'the reused project Workspace is no longer writable by this member',
      false,
    );
  }
  return context;
}

View on GitHub (pinned to 5be4028344)

Solutions

  1. Restore the member's write access to that workspace.
  2. Rebind the project to a workspace the current member can write to, or fork the project into such a workspace.
  3. Delete the stale reused-project binding if it is no longer relevant (retryable=false).
Defensive patterns

Strategy: try-catch

Validate before calling

async function projectWorkspaceStillWritable(fetcher: () => Promise<{ ok: boolean; items: Array<{ workspaceId: string; writable: boolean }> }>, workspaceId: string): Promise<boolean> {
  const dir = await fetcher();
  if (!dir.ok) return false;
  const item = dir.items.find(i => i.workspaceId === workspaceId);
  return Boolean(item && item.writable);
}

Try / catch

try {
  await authorizePersistedProjectWorkspace(workspaceId, fetcher);
} catch (err) {
  if (err instanceof AutomationWorkspaceScopeError && err.code === 'WORKSPACE_PROJECT_PERMISSION_DENIED') {
    return forbidden('The reused project Workspace is no longer writable by this member.');
  }
  throw err;
}

Prevention

When it happens

Trigger: Reusing a project whose workspace the member has since lost access to; the workspace was transferred or archived after the project binding was persisted.

Common situations: Project handover where the original owner's membership was revoked; cross-workspace project import that did not update the binding.

Related errors


AI-assisted analysis of nexu-io/open-design@5be4028344 (2026-08-12). Data as JSON: /api/errors/dc01a47caad0d156. Report an issue: GitHub.