You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Sources/repos/Client.swift
+19-13Lines changed: 19 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -5875,12 +5875,12 @@ public struct Client: APIProtocol {
5875
5875
/// List repository collaborators
5876
5876
///
5877
5877
/// For organization-owned repositories, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners.
5878
-
/// Organization members with write, maintain, or admin privileges on the organization-owned repository can use this endpoint.
5878
+
/// The `permissions` hash returned in the response contains the base role permissions of the collaborator. The `role_name` is the highest role assigned to the collaborator after considering all sources of grants, including: repo, teams, organization, and enterprise.
5879
+
/// There is presently not a way to differentiate between an organization level grant and a repository level grant from this endpoint response.
5879
5880
///
5880
5881
/// Team members will include the members of child teams.
5881
5882
///
5882
-
/// The authenticated user must have push access to the repository to use this endpoint.
5883
-
///
5883
+
/// The authenticated user must have write, maintain, or admin privileges on the repository to use this endpoint. For organization-owned repositories, the authenticated user needs to be a member of the organization.
5884
5884
/// OAuth app tokens and personal access tokens (classic) need the `read:org` and `repo` scopes to use this endpoint.
@@ -6054,11 +6054,13 @@ public struct Client: APIProtocol {
6054
6054
}
6055
6055
/// Add a repository collaborator
6056
6056
///
6057
-
/// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."
6057
+
/// Add a user to a repository with a specified level of access. If the repository is owned by an organization, this API does not add the user to the organization - a user that has repository access without being an organization member is called an "outside collaborator" (if they are not an Enterprise Managed User) or a "repository collaborator" if they are an Enterprise Managed User. These users are exempt from some organization policies - see "[Adding outside collaborators to repositories](https://docs.github.com/organizations/managing-user-access-to-your-organizations-repositories/managing-outside-collaborators/adding-outside-collaborators-to-repositories-in-your-organization)" to learn more about these collaborator types.
6058
+
///
6059
+
/// This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications).
6058
6060
///
6059
-
/// Adding an outside collaborator may be restricted by enterprise administrators. For more information, see "[Enforcing repository management policies in your enterprise](https://docs.github.com/admin/policies/enforcing-policies-for-your-enterprise/enforcing-repository-management-policies-in-your-enterprise#enforcing-a-policy-for-inviting-outside-collaborators-to-repositories)."
6061
+
/// Adding an outside collaborator may be restricted by enterprise and organization administrators. For more information, see "[Enforcing repository management policies in your enterprise](https://docs.github.com/admin/policies/enforcing-policies-for-your-enterprise/enforcing-repository-management-policies-in-your-enterprise#enforcing-a-policy-for-inviting-outside-collaborators-to-repositories)" and "[Setting permissions for adding outside collaborators](https://docs.github.com/organizations/managing-organization-settings/setting-permissions-for-adding-outside-collaborators)" for organization settings.
6060
6062
///
6061
-
/// For more information on permission levels, see "[Repository permission levels for an organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)". There are restrictions on which permissions can be granted to organization members when an organization base role is in place. In this case, the permission being given must be equal to or higher than the org base permission. Otherwise, the request will fail with:
6063
+
/// For more information on permission levels, see "[Repository permission levels for an organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)". There are restrictions on which permissions can be granted to organization members when an organization base role is in place. In this case, the role being given must be equal to or higher than the org base permission. Otherwise, the request will fail with:
6062
6064
///
6063
6065
/// ```
6064
6066
/// Cannot assign {member} permission of {role name}
@@ -6068,6 +6070,8 @@ public struct Client: APIProtocol {
6068
6070
///
6069
6071
/// The invitee will receive a notification that they have been invited to the repository, which they must accept or decline. They may do this via the notifications page, the email they receive, or by using the [API](https://docs.github.com/rest/collaborators/invitations).
6070
6072
///
6073
+
/// For Enterprise Managed Users, this endpoint does not send invitations - these users are automatically added to organizations and repositories. Enterprise Managed Users can only be added to organizations and repositories within their enterprise.
6074
+
///
6071
6075
/// **Updating an existing collaborator's permission level**
6072
6076
///
6073
6077
/// The endpoint can also be used to change the permissions of an existing collaborator without first removing and re-adding the collaborator. To change the permissions, use the same endpoint and pass a different `permission` parameter. The response will be a `204`, with no other indication that the permission level changed.
@@ -6141,7 +6145,7 @@ public struct Client: APIProtocol {
6141
6145
return .noContent(.init())
6142
6146
case 422:
6143
6147
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
6144
-
let body: Components.Responses.ValidationFailed.Body
6148
+
let body: Operations.ReposAddCollaborator.Output.UnprocessableContent.Body
6145
6149
let chosenContentType = try converter.bestContentType(
6146
6150
received: contentType,
6147
6151
options: [
@@ -6308,13 +6312,15 @@ public struct Client: APIProtocol {
6308
6312
}
6309
6313
/// Get repository permissions for a user
6310
6314
///
6311
-
/// Checks the repository permission of a collaborator. The possible repository
6312
-
/// permissions are `admin`, `write`, `read`, and `none`.
6315
+
/// Checks the repository permission and role of a collaborator.
6316
+
///
6317
+
/// The `permission` attribute provides the legacy base roles of `admin`, `write`, `read`, and `none`, where the
6318
+
/// `maintain` role is mapped to `write` and the `triage` role is mapped to `read`.
6319
+
/// The `role_name` attribute provides the name of the assigned role, including custom roles. The
6320
+
/// `permission` can also be used to determine which base level of access the collaborator has to the repository.
6313
6321
///
6314
-
/// *Note*: The `permission` attribute provides the legacy base roles of `admin`, `write`, `read`, and `none`, where the
6315
-
/// `maintain` role is mapped to `write` and the `triage` role is mapped to `read`. To determine the role assigned to the
6316
-
/// collaborator, see the `role_name` attribute, which will provide the full role name, including custom roles. The
6317
-
/// `permissions` hash can also be used to determine which base level of access the collaborator has to the repository.
6322
+
/// The calculated permissions are the highest role assigned to the collaborator after considering all sources of grants, including: repo, teams, organization, and enterprise.
6323
+
/// There is presently not a way to differentiate between an organization level grant and a repository level grant from this endpoint response.
0 commit comments