aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@gmail.com>2013-10-29 10:31:13 +0100
committerJulien Lancelot <julien.lancelot@gmail.com>2013-10-29 10:31:13 +0100
commitcf529729634625ea5d235072c399aefd11380cfb (patch)
tree095a7043cea1b478e787908bda4e64d66a055322 /sonar-server
parent0162ead4e6896a755eecc8a2aa68db5e20bdd86c (diff)
downloadsonarqube-cf529729634625ea5d235072c399aefd11380cfb.tar.gz
sonarqube-cf529729634625ea5d235072c399aefd11380cfb.zip
Fix quality flaw
Diffstat (limited to 'sonar-server')
-rw-r--r--sonar-server/src/main/java/org/sonar/server/user/UserSession.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/sonar-server/src/main/java/org/sonar/server/user/UserSession.java b/sonar-server/src/main/java/org/sonar/server/user/UserSession.java
index 6dd4938c837..f5fed66a2d4 100644
--- a/sonar-server/src/main/java/org/sonar/server/user/UserSession.java
+++ b/sonar-server/src/main/java/org/sonar/server/user/UserSession.java
@@ -32,6 +32,7 @@ import org.sonar.server.platform.Platform;
import javax.annotation.CheckForNull;
import javax.annotation.Nullable;
+
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
@@ -44,9 +45,11 @@ import static com.google.common.collect.Lists.newArrayList;
*/
public class UserSession {
- private static final ThreadLocal<UserSession> THREAD_LOCAL = new ThreadLocal<UserSession>();
public static final UserSession ANONYMOUS = new UserSession();
+
+ private static final ThreadLocal<UserSession> THREAD_LOCAL = new ThreadLocal<UserSession>();
private static final Logger LOG = LoggerFactory.getLogger(UserSession.class);
+ private static final String INSUFFICIENT_PRIVILEGES_MESSAGE = "Insufficient privileges";
private Integer userId;
private String login;
@@ -104,7 +107,7 @@ public class UserSession {
*/
public UserSession checkGlobalPermission(String globalPermission) {
if (!hasGlobalPermission(globalPermission)) {
- throw new ForbiddenException("Insufficient privileges");
+ throw new ForbiddenException(INSUFFICIENT_PRIVILEGES_MESSAGE);
}
return this;
}