From: Julien Lancelot Date: Mon, 17 Jun 2013 09:37:11 +0000 (+0200) Subject: Fix quality flaws X-Git-Tag: 3.7~475 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=cde1afca052c62580187247200bd3568c947f9d1;p=sonarqube.git Fix quality flaws --- diff --git a/sonar-core/src/main/java/org/sonar/core/issue/DefaultIssueFilter.java b/sonar-core/src/main/java/org/sonar/core/issue/DefaultIssueFilter.java index 020f89b1ae2..7b72bf621ac 100644 --- a/sonar-core/src/main/java/org/sonar/core/issue/DefaultIssueFilter.java +++ b/sonar-core/src/main/java/org/sonar/core/issue/DefaultIssueFilter.java @@ -37,9 +37,9 @@ import static com.google.common.collect.Maps.newHashMap; public class DefaultIssueFilter { - public final static String SEPARATOR = "|"; - public final static String KEY_VALUE_SEPARATOR = "="; - public final static String LIST_SEPARATOR = ","; + public static final String SEPARATOR = "|"; + public static final String KEY_VALUE_SEPARATOR = "="; + public static final String LIST_SEPARATOR = ","; private Long id; private String name; diff --git a/sonar-server/src/main/java/org/sonar/server/issue/IssueFilterService.java b/sonar-server/src/main/java/org/sonar/server/issue/IssueFilterService.java index 61dd367abc3..7b0abcffa85 100644 --- a/sonar-server/src/main/java/org/sonar/server/issue/IssueFilterService.java +++ b/sonar-server/src/main/java/org/sonar/server/issue/IssueFilterService.java @@ -63,9 +63,10 @@ public class IssueFilterService implements ServerComponent { } public DefaultIssueFilter save(DefaultIssueFilter issueFilter, UserSession userSession) { - issueFilter.setUser(userSession.login()); // TODO // checkAuthorization(userSession, project, UserRole.ADMIN); + verifyLoggedIn(userSession); + issueFilter.setUser(userSession.login()); IssueFilterDto issueFilterDto = IssueFilterDto.toIssueFilter(issueFilter); issueFilterDao.insert(issueFilterDto); return issueFilterDto.toIssueFilter(); @@ -74,6 +75,7 @@ public class IssueFilterService implements ServerComponent { public DefaultIssueFilter update(DefaultIssueFilter issueFilter, UserSession userSession) { // TODO // checkAuthorization(userSession, project, UserRole.ADMIN); + verifyLoggedIn(userSession); issueFilterDao.update(IssueFilterDto.toIssueFilter(issueFilter)); return issueFilter; } @@ -81,6 +83,7 @@ public class IssueFilterService implements ServerComponent { public void delete(Long issueFilterId, UserSession userSession) { // TODO //checkAuthorization(userSession, findActionPlanDto(actionPlanKey).getProjectKey(), UserRole.ADMIN); + verifyLoggedIn(userSession); issueFilterDao.delete(issueFilterId); }