Skip to content

Commit

Permalink
Merge pull request #76 from defreng/bugfix/75-github-no-required-acce…
Browse files Browse the repository at this point in the history
…ss-level

Drop required access level when listing groups using the GitLab API
  • Loading branch information
stefanprodan authored Jan 21, 2021
2 parents 809a301 + f3b72d8 commit 736039c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions git/provider_gitlab.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,7 @@ func (p *GitLabProvider) getProjects(ctx context.Context, gl *gitlab.Client, r *
if !p.IsPersonal {
groupAndSubGroups := strings.Split(r.Owner, "/")
lgo := &gitlab.ListGroupsOptions{
Search: gitlab.String(groupAndSubGroups[0]),
MinAccessLevel: gitlab.AccessLevel(gitlab.GuestPermissions),
Search: gitlab.String(groupAndSubGroups[0]),
}

groups, _, err := gl.Groups.ListGroups(lgo, gitlab.WithContext(ctx))
Expand All @@ -220,8 +219,7 @@ func (p *GitLabProvider) getProjects(ctx context.Context, gl *gitlab.Client, r *
if len(groupAndSubGroups) > 1 {
lastSubGroup := groupAndSubGroups[len(groupAndSubGroups)-1]
ldgo := &gitlab.ListDescendantGroupsOptions{
Search: gitlab.String(lastSubGroup),
MinAccessLevel: gitlab.AccessLevel(gitlab.GuestPermissions),
Search: gitlab.String(lastSubGroup),
}
subGroups, _, err := gl.Groups.ListDescendantGroups(*gid, ldgo, gitlab.WithContext(ctx))
subGroup := findGroupByName(subGroups, lastSubGroup)
Expand Down

0 comments on commit 736039c

Please sign in to comment.