From 31a08c185e0e730305861b7b3c6592ac8965d277 Mon Sep 17 00:00:00 2001 From: Duarte Meneses Date: Tue, 6 Oct 2020 14:45:57 -0500 Subject: [PATCH] SONAR-13941 Make applications WS available in developer edition --- .../sonar/server/permission/DefaultTemplatesResolverImpl.java | 2 +- .../sonar/server/permission/PermissionTemplateService.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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)); -- 2.39.5