roles
Creates, updates, deletes, gets or lists a roles resource.
Overview
| Name | roles |
| Type | Resource |
| Id | github.orgs.roles |
Fields
The following fields are returned by SELECT queries:
- get_org_role
- list_org_roles
Response
| Name | Datatype | Description |
|---|---|---|
id | integer (int64) | The unique identifier of the role. |
name | string | The name of the role. |
base_role | string | The system role from which this role inherits permissions. (read, triage, write, maintain, admin) |
created_at | string (date-time) | The date and time the role was created. |
description | string | A short description about who this role is for or what permissions it grants. |
organization | object | A GitHub user. (title: Simple User) |
permissions | array | A list of permissions included in this role. |
source | string | Source answers the question, "where did this role come from?" (Organization, Enterprise, Predefined) |
updated_at | string (date-time) | The date and time the role was last updated. |
Response - list of organization roles
| Name | Datatype | Description |
|---|---|---|
roles | array | The list of organization roles available to the organization. |
total_count | integer | The total number of organization roles available to the organization. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_org_role | select | org, role_id | Gets an organization role that is available to this organization. For more information on organization roles, see "Using organization roles." To use this endpoint, the authenticated user must be one of: - An administrator for the organization. - An organization member (or a member of a team) assigned a custom organization role that includes the View organization roles ( read_organization_custom_org_role) permission. For more information, see "Permissions for organization access."OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint. | |
list_org_roles | select | org | Lists the organization roles available in this organization. For more information on organization roles, see "Using organization roles." To use this endpoint, the authenticated user must be one of: - An administrator for the organization. - An organization member (or a member of a team) assigned a custom organization role that includes the View organization roles ( read_organization_custom_org_role) permission. For more information, see "Permissions for organization access."OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint. |
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 |
|---|---|---|
org | string | The organization name. The name is not case sensitive. |
role_id | integer | The unique identifier of the role. |
SELECT examples
- get_org_role
- list_org_roles
Gets an organization role that is available to this organization. For more information on organization roles, see "Using organization roles."
To use this endpoint, the authenticated user must be one of:
- An administrator for the organization.
- An organization member (or a member of a team) assigned a custom organization role that includes the View organization roles (read_organization_custom_org_role) permission. For more information, see "Permissions for organization access."
OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.
SELECT
id,
name,
base_role,
created_at,
description,
organization,
permissions,
source,
updated_at
FROM github.orgs.roles
WHERE org = '{{ org }}' -- required
AND role_id = '{{ role_id }}' -- required
;
Lists the organization roles available in this organization. For more information on organization roles, see "Using organization roles."
To use this endpoint, the authenticated user must be one of:
- An administrator for the organization.
- An organization member (or a member of a team) assigned a custom organization role that includes the View organization roles (read_organization_custom_org_role) permission. For more information, see "Permissions for organization access."
OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.
SELECT
roles,
total_count
FROM github.orgs.roles
WHERE org = '{{ org }}' -- required
;