summaryrefslogtreecommitdiffstats
path: root/sonar-server
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2012-09-06 10:11:24 +0200
committerSimon Brandhof <simon.brandhof@gmail.com>2012-09-06 10:11:24 +0200
commitc4170582180ef8dc3e2d1d0e889c9db7dd85e80a (patch)
treeef809a698fdac55343c2be9baa4171af987df669 /sonar-server
parent735f4d5ceb06cf484158c4b77cea801753c8f645 (diff)
downloadsonarqube-c4170582180ef8dc3e2d1d0e889c9db7dd85e80a.tar.gz
sonarqube-c4170582180ef8dc3e2d1d0e889c9db7dd85e80a.zip
Fix quality flaw
Diffstat (limited to 'sonar-server')
-rw-r--r--sonar-server/src/main/java/org/sonar/server/startup/SetDefaultProjectPermissions.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/sonar-server/src/main/java/org/sonar/server/startup/SetDefaultProjectPermissions.java b/sonar-server/src/main/java/org/sonar/server/startup/SetDefaultProjectPermissions.java
index dc4d24d4b8f..ce589a79bf9 100644
--- a/sonar-server/src/main/java/org/sonar/server/startup/SetDefaultProjectPermissions.java
+++ b/sonar-server/src/main/java/org/sonar/server/startup/SetDefaultProjectPermissions.java
@@ -32,6 +32,7 @@ import java.util.Map;
public class SetDefaultProjectPermissions {
private static final String SONAR_ADMINISTRATORS = "sonar-administrators";
private static final String ANYONE_AND_USERS = "Anyone,sonar-users";
+ private static final String SUFFIX = ".defaultGroups";
private final PersistentSettings persistentSettings;
@@ -55,15 +56,15 @@ public class SetDefaultProjectPermissions {
private Map<String, String> missingProperties(String qualifier) {
Map<String, String> props = Maps.newHashMap();
- if (StringUtils.isBlank(persistentSettings.getSettings().getString("sonar.role.user." + qualifier + ".defaultGroups"))) {
+ if (StringUtils.isBlank(persistentSettings.getSettings().getString("sonar.role.user." + qualifier + SUFFIX))) {
completeDefaultRoles(qualifier, props);
}
return props;
}
private void completeDefaultRoles(String qualifier, Map<String, String> props) {
- props.put("sonar.role.admin." + qualifier + ".defaultGroups", SONAR_ADMINISTRATORS);
- props.put("sonar.role.user." + qualifier + ".defaultGroups", ANYONE_AND_USERS);
- props.put("sonar.role.codeviewer." + qualifier + ".defaultGroups", ANYONE_AND_USERS);
+ props.put("sonar.role.admin." + qualifier + SUFFIX, SONAR_ADMINISTRATORS);
+ props.put("sonar.role.user." + qualifier + SUFFIX, ANYONE_AND_USERS);
+ props.put("sonar.role.codeviewer." + qualifier + SUFFIX, ANYONE_AND_USERS);
}
}