aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-db
diff options
context:
space:
mode:
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2015-08-19 15:10:38 +0200
committerTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2015-08-19 15:10:47 +0200
commit82564709cf06447b8a7e5fcadc609d892fc85509 (patch)
tree1d8e4c289b67dda92639a1e7d088947625078035 /sonar-db
parentb59537c890314a22a1fa44c41fea1b1bdcc726eb (diff)
downloadsonarqube-82564709cf06447b8a7e5fcadc609d892fc85509.tar.gz
sonarqube-82564709cf06447b8a7e5fcadc609d892fc85509.zip
SONAR-6485 WS permissions/search_project_permissions add paging field in response
Diffstat (limited to 'sonar-db')
-rw-r--r--sonar-db/src/main/java/org/sonar/db/permission/PermissionDao.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/sonar-db/src/main/java/org/sonar/db/permission/PermissionDao.java b/sonar-db/src/main/java/org/sonar/db/permission/PermissionDao.java
index 48d4c327736..773c28a44e0 100644
--- a/sonar-db/src/main/java/org/sonar/db/permission/PermissionDao.java
+++ b/sonar-db/src/main/java/org/sonar/db/permission/PermissionDao.java
@@ -41,6 +41,7 @@ public class PermissionDao implements Dao {
private static final String QUERY_PARAMETER = "query";
private static final String COMPONENT_ID_PARAMETER = "componentId";
+ private static final String ANYONE_GROUP_PARAMETER = "anyoneGroup";
private final MyBatis myBatis;
@@ -93,7 +94,7 @@ public class PermissionDao implements Dao {
public int countGroups(DbSession session, String permission, @Nullable Long componentId) {
Map<String, Object> parameters = new HashMap<>();
parameters.put("permission", permission);
- parameters.put("anyoneGroup", DefaultGroups.ANYONE);
+ parameters.put(ANYONE_GROUP_PARAMETER, DefaultGroups.ANYONE);
parameters.put(COMPONENT_ID_PARAMETER, componentId);
return mapper(session).countGroups(parameters);
@@ -120,7 +121,7 @@ public class PermissionDao implements Dao {
*/
public void groupsCountByComponentIdAndPermission(final DbSession dbSession, final List<Long> componentIds, final ResultHandler resultHandler) {
final Map<String, Object> parameters = new HashMap<>();
- parameters.put("anyoneGroup", DefaultGroups.ANYONE);
+ parameters.put(ANYONE_GROUP_PARAMETER, DefaultGroups.ANYONE);
DatabaseUtils.executeLargeInputsWithoutOutput(componentIds, new Function<List<Long>, Void>() {
@Override
@@ -136,7 +137,7 @@ public class PermissionDao implements Dao {
Map<String, Object> params = newHashMap();
params.put(QUERY_PARAMETER, query);
params.put(COMPONENT_ID_PARAMETER, componentId);
- params.put("anyoneGroup", DefaultGroups.ANYONE);
+ params.put(ANYONE_GROUP_PARAMETER, DefaultGroups.ANYONE);
return params;
}