Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to list the teams of an organization #2951

Open
arademaker opened this issue Apr 13, 2024 · 1 comment
Open

unable to list the teams of an organization #2951

arademaker opened this issue Apr 13, 2024 · 1 comment

Comments

@arademaker
Copy link

  1. I am the owner of the organization
  2. I created Fine-grained personal access tokens

What permission do I need?

auth = Auth.Token(GKEY)
g = Github(auth=auth)
org = g.get_organization(ORGNAME)
print(org)
teams = org.get_teams().  # <<- error here
for g in teams:
    print(g)
github.GithubException.GithubException: 403 {"message": "Resource not accessible by personal access token", "documentation_url": "https://docs.github.com/rest/teams/teams#list-teams"}
@arademaker arademaker changed the title uname to list the teams of an organization unable to list the teams of an organization Apr 13, 2024
@dregad
Copy link

dregad commented Apr 20, 2024

What permission do I need?

  1. Your token's Resource owner needs to be the organisation1 (i.e. when you view the token, it should read Access on the <ORG_NAME> organization. If it shows Access on <USERNAME>, you will need to create another token with the correct owner.
  2. Under Organization permissions, select Read-only (or higher) access to Members

1 The organisation must allow this: https://github.com/organizations/<ORG_NAME>/settings/personal-access-tokens

Hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants