From: Jean-Baptiste Vilain Date: Tue, 23 Jul 2013 13:51:18 +0000 (+0200) Subject: SONAR-3392 Removed sonar-users groups from Users and Codeviewers permissions in the... X-Git-Tag: 3.7~24 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5b9f2e0b139f02b22c109611c456f78c57790ec3;p=sonarqube.git SONAR-3392 Removed sonar-users groups from Users and Codeviewers permissions in the default permissions template --- 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()); }