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:
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
}