diff options
author | Guillaume Jambet <guillaume.jambet@sonarsource.com> | 2018-01-05 15:12:31 +0100 |
---|---|---|
committer | Stas Vilchik <stas.vilchik@sonarsource.com> | 2018-03-14 09:20:28 +0100 |
commit | ad9dd01e97b800714e76baa9a31e80db7ecc1c90 (patch) | |
tree | f13963072b08b517d4751bc0a936d840c3ad7db2 /server/sonar-server/src/main | |
parent | ea3457eed7977b7660716a6f76e23b87b0b3e05f (diff) | |
download | sonarqube-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.java | 5 |
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); |