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

Add method to set permission level of team collaborator on Organization repository #605

Closed
rpocase opened this issue Jul 28, 2017 · 5 comments

Comments

@rpocase
Copy link

rpocase commented Jul 28, 2017

There is currently no method in PyGithub to set the permission level of a team collaborator on a repository.

At a minimum, the method github.Team.Team.add_to_repos should take an optional parameter permission=str to set the permission level of a collaborator. The current default appears to be push.

Based on the GitHub API, reusing the same method to update repo permissions would be correct.

Relevent API reference: https://developer.github.com/v3/orgs/teams/#add-or-update-team-repository

@capnrefsmmat
Copy link

capnrefsmmat commented Aug 28, 2017

There does appear to be an undocumented Team.set_repo_permission method which does the same thing as add_to_repos, but with the permission parameter set.

@rpocase
Copy link
Author

rpocase commented Aug 29, 2017

Sounds like this issue could be resolved by documentation improvement then. For API consistency with REST, updating add_to_repos seems optimal. As a user, I would expect to have to call both Team.set_repo_permission and Team.add_to_repos without looking at the underlying implementation.

@stefan2904
Copy link

Thanks, using set_repo_permission instead of add_to_repos indeed does the job!

Why is this not documented? :(
It has a docstring and seems to be there for at least one year?

// edit, well, maybe because the documentation is old?
http://pygithub.readthedocs.io/en/latest/changes.html

@stale
Copy link

stale bot commented Jul 5, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jul 5, 2018
@rpocase
Copy link
Author

rpocase commented Jul 5, 2018

This seems to be available in the latest documentation.

@rpocase rpocase closed this as completed Jul 5, 2018
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

3 participants