Repository navigation
Commit cdb9b04
authored
Correct collaborator permission levels for personal-account repositories
## Why
Three statements in this article do not match the behaviour of the REST API. I verified each against the live API (`X-GitHub-Api-Version: 2026-03-10`).
`PUT /repos/{owner}/{repo}/collaborators/{username}` on a **private repository owned by a personal account**:
| requested | HTTP | recorded permission |
|---|---|---|
| `pull` | 201 | `read` |
| `triage` | 422 | Validation Failed |
| `push` | 201 | `write` |
| `maintain` | 422 | Validation Failed |
| `admin` | 201 | `admin` |
Control run, same script and token, against a **private repository owned by an organization** — all five values accepted and recorded as requested.
So personal-account repositories do support read, write and admin for collaborators. Only `triage` and `maintain` are organization-only, and the API rejects those explicitly with a `422` rather than silently substituting another level.
Enforcement was confirmed independently: a collaborator granted `pull` on a private personal-account repository has `git push` rejected by the server and cannot access repository settings, while a collaborator granted `admin` can.
## Scope of this change
- Verified on GitHub.com only (`fpt` / `ghec`). This article is also versioned for `ghes`, which I could not test. Happy to wrap the change in `{% ifversion fpt or ghec %}` if a maintainer confirms GHES behaves differently.
- I deliberately did **not** touch the "Owner access" table. If admin can be granted to a collaborator, some entries there may also need revisiting, but I have not tested which, so I left it alone rather than guess.
Refs #455371 parent b2bcc82 commit cdb9b04
1 file changed
Lines changed: 3 additions & 3 deletions
File tree
- content/repositories/managing-your-repositorys-settings-and-features/repository-access-and-collaboration
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| |||
0 commit comments