Skip to main content
Мы публикуем частые обновления нашей документации, и перевод этой страницы, возможно, еще выполняется. Актуальные сведения см. в документации на английском языке.

Поддержка этой версии GitHub Enterprise была прекращена 2023-03-15. Исправления выпускаться не будут даже при критических проблемах безопасности. Для повышения производительности, укрепления безопасности и новых функций установите последнюю версию GitHub Enterprise. Чтобы получить справку по обновлению, обратитесь в службу поддержки GitHub Enterprise.

Пользовательские роли репозитория

Используйте REST API для взаимодействия с пользовательскими ролями репозитория.

List custom repository roles in an organization

Работа с GitHub Apps

List the custom repository roles available in this organization. In order to see custom repository roles in an organization, the authenticated user must be an organization owner.

To use this endpoint the authenticated user must be an administrator for the organization or of an repository of the organization and must use an access token with admin:org repo scope. GitHub Apps must have the organization_custom_roles:read organization permission to use this endpoint.

For more information on custom repository roles, see "About custom repository roles."

Параметры для "List custom repository roles in an organization"

Заголовки
Имя, Тип, Описание
acceptstring

Setting to application/vnd.github+json is recommended.

Параметры пути
Имя, Тип, Описание
organization_idstringОбязательно

The unique identifier of the organization.

Коды состояния HTTP-ответа для "List custom repository roles in an organization"

Код состоянияОписание
200

Response - list of custom role names

Примеры кода для "List custom repository roles in an organization"

get/organizations/{organization_id}/custom_roles
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ http(s)://HOSTNAME/api/v3/organizations/ORGANIZATION_ID/custom_roles

Response - list of custom role names

Status: 200
{ "total_count": 2, "custom_roles": [ { "id": 8030, "name": "Developer" }, { "id": 8031, "name": "Designer" } ] }