Add member role filter to OrganizationMembersClient.GetAll() functions #1072
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While working on implementing GitHub Enterprise APIs I came across the fact that the OrganizationMembers API implementation was missing the "Role" filter option (all, admin, member).
https://developer.github.com/v3/orgs/members/#parameters
I also added integration tests for the GetAll method (previously there were none for this whole API) and all work fine in my integration tests...
however I found that querying for Admin/Member role only returns correct results when the requester is a member of the organization. When the requester is not in the organization, the member and admin filters just return all users in the org.
I also found that with the existing "filter" attribute (2fa_disabled, all) only owners of an organization are allowed to use the
2fa_disabled
filter, and octokit throws an exception if the requester is not an org owner.Im not sure what settings you guys run the integration tests under for octokit.net so I have set the integration tests that would have triggered these conditions, to SKIP for now. If the integration tests on AppVeyor/Travis do run as an org member or org admin, let me know and I can un-skip the tests (i also need to know the name of the org to use in the queries... currently "octokit" is used).