---
title: "Get repository permissions for a user"
method: GET
path: "/repos/{owner}/{repo}/collaborators/{username}/permission"
tags: ["repos"]
---

# Get repository permissions for a user

`GET /repos/{owner}/{repo}/collaborators/{username}/permission`

Checks the repository permission and role of a collaborator.

The `permission` attribute provides the legacy base roles of `admin`, `write`, `read`, and `none`, where the
`maintain` role is mapped to `write` and the `triage` role is mapped to `read`.
The `role_name` attribute provides the name of the assigned role, including custom roles. The
`permission` can also be used to determine which base level of access the collaborator has to the repository.

The calculated permissions are the highest role assigned to the collaborator after considering all sources of grants, including: repo, teams, organization, and enterprise.
There is presently not a way to differentiate between an organization level grant and a repository level grant from this endpoint response.

## Path parameters

- `owner` string, required
- `repo` string, required
- `username` string, required

## Response `200`

if user has admin permissions

- RepositoryCollaboratorPermission — Repository Collaborator Permission
  - `permission` string, required
  - `role_name` string, required
  - `user` NullableCollaborator, nullable, required — Collaborator
    - `login` string, required
    - `id` integer, required
    - `email` string, nullable
    - `name` string, nullable
    - `node_id` string, required
    - `avatar_url` string, uri, required
    - `gravatar_id` string, nullable, required
    - `url` string, uri, required
    - `html_url` string, uri, required
    - `followers_url` string, uri, required
    - `following_url` string, required
    - `gists_url` string, required
    - `starred_url` string, required
    - `subscriptions_url` string, uri, required
    - `organizations_url` string, uri, required
    - `repos_url` string, uri, required
    - `events_url` string, required
    - `received_events_url` string, uri, required
    - `type` string, required
    - `site_admin` boolean, required
    - `permissions` object
      - `pull` boolean, required
      - `triage` boolean
      - `push` boolean, required
      - `maintain` boolean
      - `admin` boolean, required
    - `role_name` string, required
    - `user_view_type` string

## Other responses

- `404` — Resource not found

---

[API](https://skmtc.net/github/apis/api-github-com.md) · [All operations](https://skmtc.net/github/apis/api-github-com/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/github/api-github-com/revisions/a367f7028301/schema)
