aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-db-dao
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2017-05-10 20:47:56 +0200
committerSimon Brandhof <simon.brandhof@sonarsource.com>2017-05-10 23:08:31 +0200
commit507a364e04aeda658041c3794ab96667ebdf531e (patch)
tree61d701accacb1245d7b2e4a540ddce4a1d12d7ac /server/sonar-db-dao
parent10e686608dd3c963ec88dfd7968424331330d584 (diff)
downloadsonarqube-507a364e04aeda658041c3794ab96667ebdf531e.tar.gz
sonarqube-507a364e04aeda658041c3794ab96667ebdf531e.zip
Fix bug in AuthorizationDao#keepAuthorizedProjectIds()
Input of ids is not correctly partitioned. The SQL request may fail on some databases (Oracle at least) if the input list of ids is greater than 1'000 elements.
Diffstat (limited to 'server/sonar-db-dao')
-rw-r--r--server/sonar-db-dao/src/main/java/org/sonar/db/permission/AuthorizationDao.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/permission/AuthorizationDao.java b/server/sonar-db-dao/src/main/java/org/sonar/db/permission/AuthorizationDao.java
index d55f13ce0e7..06eda851274 100644
--- a/server/sonar-db-dao/src/main/java/org/sonar/db/permission/AuthorizationDao.java
+++ b/server/sonar-db-dao/src/main/java/org/sonar/db/permission/AuthorizationDao.java
@@ -124,14 +124,14 @@ public class AuthorizationDao implements Dao {
return mapper(dbSession).selectOrganizationUuidsOfUserWithGlobalPermission(userId, permission);
}
- public Set<Long> keepAuthorizedProjectIds(DbSession dbSession, Collection<Long> componentIds, @Nullable Integer userId, String role) {
+ public Set<Long> keepAuthorizedProjectIds(DbSession dbSession, Collection<Long> componentIds, @Nullable Integer userId, String permission) {
return executeLargeInputsIntoSet(
componentIds,
partition -> {
if (userId == null) {
- return mapper(dbSession).keepAuthorizedProjectIdsForAnonymous(role, componentIds);
+ return mapper(dbSession).keepAuthorizedProjectIdsForAnonymous(permission, partition);
}
- return mapper(dbSession).keepAuthorizedProjectIdsForUser(userId, role, componentIds);
+ return mapper(dbSession).keepAuthorizedProjectIdsForUser(userId, permission, partition);
});
}