From 5b9f2e0b139f02b22c109611c456f78c57790ec3 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Vilain Date: Tue, 23 Jul 2013 15:51:18 +0200 Subject: [PATCH] SONAR-3392 Removed sonar-users groups from Users and Codeviewers permissions in the default permissions template --- .../org/sonar/server/startup/RegisterPermissionTemplates.java | 2 -- .../sonar/server/startup/RegisterPermissionTemplatesTest.java | 3 +-- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/sonar-server/src/main/java/org/sonar/server/startup/RegisterPermissionTemplates.java b/sonar-server/src/main/java/org/sonar/server/startup/RegisterPermissionTemplates.java index 5e85f988f0d..22d6d8b6fe4 100644 --- a/sonar-server/src/main/java/org/sonar/server/startup/RegisterPermissionTemplates.java +++ b/sonar-server/src/main/java/org/sonar/server/startup/RegisterPermissionTemplates.java @@ -81,9 +81,7 @@ public class RegisterPermissionTemplates { PermissionTemplateDto defaultPermissionTemplate = permissionDao .createPermissionTemplate(templateName, PermissionTemplateDto.DEFAULT.getDescription()); addGroupPermission(defaultPermissionTemplate, UserRole.ADMIN, DefaultGroups.ADMINISTRATORS); - addGroupPermission(defaultPermissionTemplate, UserRole.USER, DefaultGroups.USERS); addGroupPermission(defaultPermissionTemplate, UserRole.USER, DefaultGroups.ANYONE); - addGroupPermission(defaultPermissionTemplate, UserRole.CODEVIEWER, DefaultGroups.USERS); addGroupPermission(defaultPermissionTemplate, UserRole.CODEVIEWER, DefaultGroups.ANYONE); } diff --git a/sonar-server/src/test/java/org/sonar/server/startup/RegisterPermissionTemplatesTest.java b/sonar-server/src/test/java/org/sonar/server/startup/RegisterPermissionTemplatesTest.java index f8c147b1544..3e23d2731ae 100644 --- a/sonar-server/src/test/java/org/sonar/server/startup/RegisterPermissionTemplatesTest.java +++ b/sonar-server/src/test/java/org/sonar/server/startup/RegisterPermissionTemplatesTest.java @@ -71,10 +71,9 @@ public class RegisterPermissionTemplatesTest { verify(loadedTemplateDao).insert(argThat(Matches.template(expectedTemplate))); verify(permissionDao).createPermissionTemplate(PermissionTemplateDto.DEFAULT.getName(), PermissionTemplateDto.DEFAULT.getDescription()); verify(permissionDao).addGroupPermission(1L, 1L, UserRole.ADMIN); - verify(permissionDao).addGroupPermission(1L, 2L, UserRole.USER); verify(permissionDao).addGroupPermission(1L, null, UserRole.USER); - verify(permissionDao).addGroupPermission(1L, 2L, UserRole.CODEVIEWER); verify(permissionDao).addGroupPermission(1L, null, UserRole.CODEVIEWER); + verifyNoMoreInteractions(permissionDao); verify(settings).saveProperty(RegisterPermissionTemplates.DEFAULT_TEMPLATE_PROPERTY, PermissionTemplateDto.DEFAULT.getKee()); } -- 2.39.5