use of io.pivotal.cla.egit.github.core.service.WithPermissionsRepositoryService in project pivotal-cla by pivotalsoftware.
the class MylynGitHubApi method findRepositoryNamesWithAdminPermission.
@Override
@SneakyThrows
public List<String> findRepositoryNamesWithAdminPermission(String accessToken) {
GitHubClient client = createClient(accessToken);
WithPermissionsRepositoryService service = new WithPermissionsRepositoryService(client);
List<WithPermissionsRepository> repositories = service.getPermissionRepositories();
List<String> repoSlugs = new ArrayList<>();
for (WithPermissionsRepository r : repositories) {
if (!r.getPermissions().isAdmin()) {
continue;
}
org.eclipse.egit.github.core.User owner = r.getOwner();
repoSlugs.add(owner.getLogin() + "/" + r.getName());
}
return repoSlugs;
}
Aggregations