From cde1afca052c62580187247200bd3568c947f9d1 Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Mon, 17 Jun 2013 11:37:11 +0200 Subject: [PATCH] Fix quality flaws --- .../main/java/org/sonar/core/issue/DefaultIssueFilter.java | 6 +++--- .../java/org/sonar/server/issue/IssueFilterService.java | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) 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); } -- 2.39.5