Skip to content
19 linesCodeBlameRaw

Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.

Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look1/**
2 * Who may do what with a project: each method's capability on the
3 * project's repository. Seeing a project takes Read; changing it (its name,
Projects no longer depend on each other: the dependsOn relation, its settings page (old links redirect), the overview card, a pull request's Affects panel and preview stacks, reference variables and agents' notes on what a project uses are gone; the table is dropped in a later deploy4 * root directory and settings) takes Maintain (`manage_settings`).
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look5 * Types only, so the table is tested apart from the service.
6 */
7
8import type { Capability, RepoRef } from "@g1t/contracts";
9
10export const NEEDS = {
11 get: "read",
12 create: "manage_settings",
13 update: "manage_settings",
14} as const satisfies Record<string, Capability>;
15
16/** The repository a stored project's permission comes from. */
17export function repoRef(row: { repo_id: string; repo_namespace: string; repo_private: number | boolean }): RepoRef {
18 return { id: row.repo_id, namespace: row.repo_namespace, isPrivate: !!row.repo_private };
19}