use of com.thoughtworks.go.apiv4.configrepos.representers.ConfigReposConfigRepresenterV4 in project gocd by gocd.
the class ConfigReposControllerV4 method index.
String index(Request req, Response res) {
ConfigReposConfig repos = allRepos();
ConfigReposConfig userSpecificRepos = repos.stream().filter(configRepoConfig -> authHelper.doesUserHasPermissions(currentUsername(), getAction(req), CONFIG_REPO, configRepoConfig.getId())).collect(toCollection(ConfigReposConfig::new));
String etag = entityHashingService.hashForEntity(userSpecificRepos);
setEtagHeader(res, etag);
if (fresh(req, etag)) {
return notModified(res);
}
return jsonizeAsTopLevelObject(req, w -> ConfigReposConfigRepresenterV4.toJSON(w, userSpecificRepos));
}
Aggregations