in webhook-app/github_helper.py [0:0]
def get_permission(gh, owner, repo, user):
# Required to access the collaborators API.
headers = {'Accept': 'application/vnd.github.korra-preview'}
result = gh.session.get(
'https://api.github.com/repos/{}/{}/collaborators'
'/{}/permission'.format(owner, repo, user),
headers=headers).json()
return result['permission']