aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-server/src/main
diff options
context:
space:
mode:
authorGuillaume Jambet <guillaume.jambet@sonarsource.com>2018-01-05 15:12:31 +0100
committerStas Vilchik <stas.vilchik@sonarsource.com>2018-03-14 09:20:28 +0100
commitad9dd01e97b800714e76baa9a31e80db7ecc1c90 (patch)
treef13963072b08b517d4751bc0a936d840c3ad7db2 /server/sonar-server/src/main
parentea3457eed7977b7660716a6f76e23b87b0b3e05f (diff)
downloadsonarqube-ad9dd01e97b800714e76baa9a31e80db7ecc1c90.tar.gz
sonarqube-ad9dd01e97b800714e76baa9a31e80db7ecc1c90.zip
SONAR-10222 Fail when searching member organizations and unauthenticated
Diffstat (limited to 'server/sonar-server/src/main')
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/organization/ws/SearchAction.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/organization/ws/SearchAction.java b/server/sonar-server/src/main/java/org/sonar/server/organization/ws/SearchAction.java
index 2b454da4f4d..6e939c99bfa 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/organization/ws/SearchAction.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/organization/ws/SearchAction.java
@@ -88,6 +88,11 @@ public class SearchAction implements OrganizationsWsAction {
@Override
public void handle(Request request, Response response) throws Exception {
+ boolean isMember = request.mandatoryParamAsBoolean(PARAM_MEMBER);
+ if (isMember){
+ userSession.checkLoggedIn();
+ }
+
try (DbSession dbSession = dbClient.openSession(false)) {
OrganizationQuery dbQuery = buildDbQuery(request);
int total = dbClient.organizationDao().countByQuery(dbSession, dbQuery);