Public: anyone can read this; the crew can change it.
Access 2: one `may(principal, action, resource)`, with the repository checks behind it first #18048
Landed in pull #18065 · 2 runs · run
Add to this slice, asked for by the Apple app: a client must be able to ask what it may do instead of reading a role. Put a capability list on GET /api/v1/user (the actions this principal may take forge-wide, by the registry's action names) and one cheap read for a resource, for example GET /api/v1/may?action=…&resource=… answering yes or no with the reason in words. Today the app shows its Admin section when /user says isAdmin (display only; the forge enforces). Clients then drop role checks. Both in openapi.json and contract-tested.
Reviewed pull #18065 at its head: ticked may(principal, action, resource) and a small registry of actions, each with one sentence a person can read. It answers yes, or no with which of the forge's existing answers applies (not found, sign in, forbidden), keeping the rule in src/actions/access.ts: what you may not read does not exist for you.; canRead, canWrite and canAdmin, the actions/access.ts wrappers and the CAN abilities delegate to it. Token scope (scopeAllows) and "a token is not a person" (isAccountItself) become part of the same answer, not a second check beside it.; A test pins that every existing answer is unchanged, for anonymous, guest, member, admin, and each token kind, on a public and a private repository..
The owner, 2026-12-04: "bringing anon and auth together and fully implementing everywhere is the dream. anon and signed in users are understood. rbac everywhere."
Read from main on 2026-12-04: who is asking is
Authinsrc/http/context.ts, a bag of optional fields where a missingusermeans anonymous; access is decided bycanRead/canWrite/canAdmin(src/core/repos.ts), theactions/access.tswrappers, theCANtable insrc/core/roles.ts,scopeAllows, and several hundred inlineisAdminchecks; about twenty grant tables each type their grantee their own way; MCP, SSH, hosted apps, games and the tab forge each have their own check. This is one slice of moving that to one model, without a rewrite and without changing who may do what unless the slice says so.After Access 1.
Build:
Done when: the repository trio has one implementation and the pinned answers match today's.