|
| 1 | +--- |
| 2 | +kind:change |
| 3 | +title:API enhancements for working with organization permissions |
| 4 | +created_at:2015-06-24 |
| 5 | +author_name:jakeboxer |
| 6 | +--- |
| 7 | + |
| 8 | +We're introducing several enhancements to allow API developers to take advantage of the[improved organization permissions][dotcom-blog-post] that we are rolling out. Learn about these enhancements and how you can try them out below. |
| 9 | + |
| 10 | +Since we're rolling out the[improved organization permissions][dotcom-blog-post] improvements slowly, these enhancements will only apply to certain organizations at first. Most of these enhancements will degrade gracefully (returning an empty array or something similar) if used on an organization that doesn't support improved organization permissions yet. Check the documentation for your specific API to see if errors are possible. |
| 11 | + |
| 12 | +##API enhancements |
| 13 | + |
| 14 | +###Team permissions |
| 15 | + |
| 16 | +In our improved permissions system, a team no longer has a single permission that applies to all of its repositories. Instead, each repository is added to a team with its own permission. For example, an organization could use a single team to grant pull access to one repository, push access to a second, and admin access to a third. |
| 17 | + |
| 18 | +The team APIs now support this more granular notion of permissions: |
| 19 | + |
| 20 | +- The[Add team repository][add-team-repo] API accepts a`permission` parameter, so that you can specify whether a team should grant`pull`,`push`, or`admin` access on a given repository. |
| 21 | +- In the[List team repositories][list-team-repos] and[Check if a team manages a repository][get-team-repo] API, the response includes a`permissions` attribute, indicating whether the team grants`pull`,`push`, or`admin` access on each repository. |
| 22 | +- The`permission` parameter in the[Create team][create-team] and[Edit team][edit-team] APIs is deprecated. Since teams can grant a different permission on each repository, this parameter no longer dictates what permission a team grants on all of its repositories. Instead, it dictates the default permission that the[Add team repository][add-team-repo] API will use for requests where no`permission` parameter is specified. |
| 23 | + |
| 24 | +###Team privacy |
| 25 | + |
| 26 | +We now allow you to modify the privacy level of your teams. A "secret" team can only be seen by organization owners and people who are members of that team (which is how all teams have worked historically), while a "closed" team is visible to every member of the organization (which makes it easier to use[@mentions][team-mentions] throughout your organization). |
| 27 | + |
| 28 | +The team APIs now support this new team privacy concept: |
| 29 | + |
| 30 | +- The[Create team][create-team] and[Edit team][edit-team] APIs accept a`privacy` parameter, so that you can specify whether a team should be`secret` or`closed`. |
| 31 | +- All team resources in the API now include a`privacy` attribute, indicating whether the team is`secret` or`closed`. |
| 32 | + |
| 33 | +###Team maintainers |
| 34 | + |
| 35 | +We've added the ability for you to delegate team maintenance to non-owners, reducing the workload for your organization's owners. You can now promote a non-owner member of a team to be a "maintainer" of that team. A maintainer can add and remove team members and change the team's title and description. |
| 36 | + |
| 37 | +The team membership APIs now support this new team maintainer concept: |
| 38 | + |
| 39 | +- The[Add team membership][add-team-membership] API accepts a`role` parameter, so that you can specify whether a given team member should be a`maintainer` or a regular`member`. |
| 40 | +- The[List team members][list-team-members] API accepts an optional`role` parameter, allowing you to fetch only`maintainer`s or only regular`member`s. |
| 41 | +- In the[Get team membership][get-team-membership] and[Add team membership][add-team-membership] APIs, the response includes a`role` attribute, indicating whether a user is a`maintainer` or a regular`member` of the team. |
| 42 | + |
| 43 | +For more information on our improved team permissions, check out our[documentation][understanding-team-permissions]. |
| 44 | + |
| 45 | +###Filtering organization members by role |
| 46 | + |
| 47 | +The organization[Members list][org-members-list] API now accepts a`role` parameter, so that you can request to see only the owners (or non-owners) of your organization. |
| 48 | + |
| 49 | +###Repository collaborators |
| 50 | + |
| 51 | +We now allow you to add collaborators directly to organization-owned repositories, just like we always have for user-owned repositories. |
| 52 | + |
| 53 | +The collaborator APIs now support organization-owned repositories: |
| 54 | + |
| 55 | +- The[Add user as a collaborator][add-collab] API works for organization-owned repositories. We've also added a`permission` parameter to it (currently valid for organization-owned repositories only), so that you can specify what level of access the collaborator should have on the repository. |
| 56 | +- In the[List collaborators][list-collabs] API, the response includes a`permissions` attribute describing the permissions that each collaborator has on your organization's repositories. |
| 57 | + |
| 58 | +##Preview period |
| 59 | + |
| 60 | +Starting today, these API enhancements are available for developers to preview. At the end of the preview period, these enhancements will become official components of the GitHub API. |
| 61 | + |
| 62 | +While these enhancements are in their preview period, you'll need to provide the following[custom media type][custom-media-types] in the`Accept` header: |
| 63 | + |
| 64 | +application/vnd.github.ironman-preview+json |
| 65 | + |
| 66 | +During the preview period, we may change aspects of these enhancements. If we do, we will announce the changes on the developer blog, but we will not provide any advance notice. |
| 67 | + |
| 68 | +##Send us your feedback |
| 69 | + |
| 70 | +We would love to hear your thoughts on these enhancements. If you have any questions or feedback, please[get in touch with us][contact]! |
| 71 | + |
| 72 | +[dotcom-blog-post]:https://github.com/blog/2020-improved-organization-permissions |
| 73 | +[understanding-team-permissions]:https://help.github.com/articles/improved-organization-permissions/#understanding-team-permissions |
| 74 | +[create-team]:/v3/orgs/teams/#create-team |
| 75 | +[edit-team]:/v3/orgs/teams/#edit-team |
| 76 | +[list-team-members]:/v3/orgs/teams/#list-team-members |
| 77 | +[get-team-membership]:/v3/orgs/teams/#get-team-membership |
| 78 | +[add-team-membership]:/v3/orgs/teams/#add-team-membership |
| 79 | +[list-team-repos]:/v3/orgs/teams/#list-team-repos |
| 80 | +[get-team-repo]:/v3/orgs/teams/#get-team-repo |
| 81 | +[add-team-repo]:/v3/orgs/teams/#add-team-repo |
| 82 | +[org-members-list]:/v3/orgs/members/#members-list |
| 83 | +[org-public-members-list]:/v3/orgs/members/#public-members-list |
| 84 | +[list-collabs]:/v3/repos/collaborators/#list |
| 85 | +[add-collab]:/v3/repos/collaborators/#add-collaborator |
| 86 | +[contact]:https://github.com/contact?form[subject]=Organization+Permissions+API |
| 87 | +[team-mentions]:https://github.com/blog/1121-introducing-team-mentions |
| 88 | +[custom-media-types]:/v3/media/ |