Skip to content

Correct collaborator permission levels for personal-account repositories - #45538

Open
aaronariasperez wants to merge 1 commit into
github:mainfrom
aaronariasperez:patch-1
Open

Correct collaborator permission levels for personal-account repositories#45538
aaronariasperez wants to merge 1 commit into
github:mainfrom
aaronariasperez:patch-1

Conversation

@aaronariasperez

Copy link
Copy Markdown

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 #45537

Why:

Closes:

What's being changed (if available, include any code snippets, screenshots, or gifs):

Check off the following:

  • A subject matter expert (SME) has reviewed the technical accuracy of the content in this PR. In most cases, the author can be the SME. Open source contributions may require an SME review from GitHub staff.
  • The changes in this PR meet the docs fundamentals that are required for all content.
  • All CI checks are passing and the changes look good in the review environment.

## 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 github#45537
@github-actions

Copy link
Copy Markdown
Contributor

How to review these changes 👓

Thank you for your contribution. To review these changes, choose one of the following options:

A Hubber will need to deploy your changes internally to review.

Table of review links

Note: Please update the URL for your staging server or codespace.

The table shows the files in the content directory that were changed in this pull request. This helps you review your changes on a staging server. Changes to the data directory are not included in this table.

Source Review Production What Changed
repositories/managing-your-repositorys-settings-and-features/repository-access-and-collaboration/permission-levels-for-a-personal-account-repository.md fpt
ghec
ghes@ 3.22 3.21 3.20 3.19 3.18 3.17
fpt
ghec
ghes@ 3.22 3.21 3.20 3.19 3.18 3.17

Key: fpt: Free, Pro, Team; ghec: GitHub Enterprise Cloud; ghes: GitHub Enterprise Server

🤖 This comment is automatically generated.

@github-actions github-actions Bot added the triage Do not begin working on this issue until triaged by the team label Aug 18, 2026
@subatoi

subatoi commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Please see my comment here 🙇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

triage Do not begin working on this issue until triaged by the team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants