collaborator_permissions
Creates, updates, deletes, gets or lists a collaborator_permissions resource.
Overview
| Name | collaborator_permissions |
| Type | Resource |
| Id | github.repos.collaborator_permissions |
Fields
The following fields are returned by SELECT queries:
- get_collaborator_permission_level
if user has admin permissions
| Name | Datatype | Description |
|---|---|---|
role_name | string | (example: admin) |
permission | string | |
user | object | Collaborator (title: Collaborator) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_collaborator_permission_level | select | owner, repo, username | Checks the repository permission and role of a collaborator. The permission attribute provides the legacy base roles of admin, write, read, and none, where themaintain 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. Thepermission 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. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
owner | string | The account owner of the repository. The name is not case sensitive. |
repo | string | The name of the repository without the .git extension. The name is not case sensitive. |
username | string | The handle for the GitHub user account. |
SELECT examples
- get_collaborator_permission_level
Checks the repository permission and role of a collaborator.
The permission attribute provides the legacy base roles of admin, write, read, and none, where themaintain 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. Thepermission 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.
SELECT
role_name,
permission,
user
FROM github.repos.collaborator_permissions
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
AND username = '{{ username }}' -- required
;