Skip to content

Commit 51b21c1

Browse files
committed
List only user-accessible projects
The Gitlab API's `getAllProjects` method requires an admin user to be connected. Use the `api.getProjects()` method instead, which lists all projects **accessible** to the connected user, so the proxy can be used with a non-admin user.
1 parent c3a3b82 commit 51b21c1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/main/java/com/dkaedv/glghproxy/controller/UsersController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public List<Repository> getReposForUser(
4242
LOG.info("Received request: username=" + username + ", per_page=" + per_page + ", page=" + page);
4343

4444
GitlabAPI api = gitlab.connect(authorization);
45-
List<GitlabProject> projects = api.getAllProjects();
45+
List<GitlabProject> projects = api.getProjects();
4646

4747
return GitlabToGithubConverter.convertRepositories(projects);
4848
}

0 commit comments

Comments
 (0)