From: Duarte Meneses Date: Tue, 6 Oct 2020 19:45:57 +0000 (-0500) Subject: SONAR-13941 Make applications WS available in developer edition X-Git-Tag: 8.6.0.39681~146 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=31a08c185e0e730305861b7b3c6592ac8965d277;p=sonarqube.git SONAR-13941 Make applications WS available in developer edition --- diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/DefaultTemplatesResolverImpl.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/DefaultTemplatesResolverImpl.java index 2e2217837b6..9553d20716a 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/DefaultTemplatesResolverImpl.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/DefaultTemplatesResolverImpl.java @@ -54,7 +54,7 @@ public class DefaultTemplatesResolverImpl implements DefaultTemplatesResolver { return resourceTypes.getRoots() .stream() .map(ResourceType::getQualifier) - .anyMatch(Qualifiers.VIEW::equals); + .anyMatch(qualifier -> Qualifiers.VIEW.equals(qualifier) || Qualifiers.APP.equals(qualifier)); } } diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/PermissionTemplateService.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/PermissionTemplateService.java index 17a0d91f4bc..ead26f0ac17 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/PermissionTemplateService.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/permission/PermissionTemplateService.java @@ -207,11 +207,11 @@ public class PermissionTemplateService { return dbClient.permissionTemplateDao().selectByUuid(dbSession, resolvedDefaultTemplates.getProject()); case Qualifiers.VIEW: String portDefaultTemplateUuid = resolvedDefaultTemplates.getPortfolio().orElseThrow( - () -> new IllegalStateException("Attempt to create a view when Governance plugin is not installed")); + () -> new IllegalStateException("Failed to find default template for portfolios")); return dbClient.permissionTemplateDao().selectByUuid(dbSession, portDefaultTemplateUuid); case Qualifiers.APP: String appDefaultTemplateUuid = resolvedDefaultTemplates.getApplication().orElseThrow( - () -> new IllegalStateException("Attempt to create a view when Governance plugin is not installed")); + () -> new IllegalStateException("Failed to find default template for applications")); return dbClient.permissionTemplateDao().selectByUuid(dbSession, appDefaultTemplateUuid); default: throw new IllegalArgumentException(format("Qualifier '%s' is not supported", qualifier));