Determine a collaborator's permissions (to an organization repos) via the api?

后端 未结 2 1978
借酒劲吻你
借酒劲吻你 2021-01-02 06:13

In a repos that belongs to an organization (as opposed to an individual), collaborators are members of \"teams\", and teams can have three different kinds of permissions:

2条回答
  •  攒了一身酷
    2021-01-02 06:57

    If you want to check whether you have push access to a GitHub repo, you can use the repo endpoint:

    GET /repos/:owner/:repo

    If your request includes your authorization information (either including your account credentials or an OAuth access token), the permissions field will give you the information you're looking for:

    { 'admin': False, 'push': False, 'pull': True }

提交回复
热议问题