use of org.sonar.server.permission.ws.template.DefaultTemplatesResolver.ResolvedDefaultTemplates in project sonarqube by SonarSource.
the class SearchTemplatesDataLoader method load.
public SearchTemplatesData load(DbSession dbSession, SearchTemplatesWsRequest request) {
SearchTemplatesData.Builder data = builder();
List<PermissionTemplateDto> templates = searchTemplates(dbSession, request);
List<Long> templateIds = Lists.transform(templates, PermissionTemplateDto::getId);
DefaultTemplates defaultTemplates = checkFoundWithOptional(dbClient.organizationDao().getDefaultTemplates(dbSession, request.getOrganizationUuid()), "No Default templates for organization with uuid '%s'", request.getOrganizationUuid());
ResolvedDefaultTemplates resolvedDefaultTemplates = defaultTemplatesResolver.resolve(defaultTemplates);
data.templates(templates).defaultTemplates(resolvedDefaultTemplates).userCountByTemplateIdAndPermission(userCountByTemplateIdAndPermission(dbSession, templateIds)).groupCountByTemplateIdAndPermission(groupCountByTemplateIdAndPermission(dbSession, templateIds)).withProjectCreatorByTemplateIdAndPermission(withProjectCreatorsByTemplateIdAndPermission(dbSession, templateIds));
return data.build();
}
Aggregations