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

Only fetch projects with min access level #166

Merged
merged 2 commits into from
Mar 11, 2019
Merged

Conversation

JaimeLennox
Copy link
Contributor

If we're on an appropriate GitLab version, that is. GitLab doesn't return the right permissions for projects belonging to the user if the project is in a subgroup, and Marge is set as a member of the top-level group[1]. This is rather annoying as Marge will then complain that she doesn't have permissions for a project when she does.

A new field available in GitLab version >= 11.2 allows us to only fetch projects for which we have a certain access level. This returns the right projects even with nested groups, so we can prefer this method if it is available.

Fixes: #156

The values should always be ints, and this makes the code simpler.
If we're on an appropriate GitLab version, that is. GitLab doesn't
return the right permissions for projects belonging to the user if the
project is in a subgroup, and Marge is set as a member of the top-level
group[1]. This is rather annoying as Marge will then complain that she
doesn't have permissions for a project when she does.

A new field available in GitLab version >= 11.2 allows us to only fetch
projects for which we have a certain access level. This returns the
right projects even with nested groups, so we can prefer this method if
it is available.
@JaimeLennox JaimeLennox requested a review from aschmolck March 9, 2019 11:25
@aschmolck
Copy link
Contributor

Very annoying they still haven't fixed this issue upstream, 9 months later, so although I'm not too keen to accumulate more and more workarounds for gitlab bugs let's merge this.

@aschmolck aschmolck merged commit 2b7531e into master Mar 11, 2019
@aschmolck aschmolck deleted the group-permissions branch March 11, 2019 09:16
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

Successfully merging this pull request may close these issues.

2 participants