From f3b72d8fb77778257a9129b62981d5b8dc30b015 Mon Sep 17 00:00:00 2001 From: Alexander Hungenberg Date: Thu, 21 Jan 2021 14:08:20 +0100 Subject: [PATCH] dropping required access level when listing groups using the GitLab API This will make it possible to use project-level access tokens Resolves: #75 Signed-off-by: Alexander Hungenberg --- git/provider_gitlab.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/git/provider_gitlab.go b/git/provider_gitlab.go index da591087..a3b27ff6 100644 --- a/git/provider_gitlab.go +++ b/git/provider_gitlab.go @@ -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)) @@ -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)