aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>2015-06-03 14:05:30 +0200
committerJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>2015-06-03 14:05:30 +0200
commit00c361c7ac7032214792766ecb83caeb769ec42d (patch)
treef74b519445f79f9c7373352b860b3ebe90c9e998 /server
parent73c9ef7cd4d33feeede26793c515a65730f6feaf (diff)
downloadsonarqube-00c361c7ac7032214792766ecb83caeb769ec42d.tar.gz
sonarqube-00c361c7ac7032214792766ecb83caeb769ec42d.zip
SONAR-6470 Add group ID in api/users/groups response
Diffstat (limited to 'server')
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/user/ws/GroupsAction.java2
-rw-r--r--server/sonar-server/src/main/resources/org/sonar/server/user/ws/example-groups.json4
2 files changed, 4 insertions, 2 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/user/ws/GroupsAction.java b/server/sonar-server/src/main/java/org/sonar/server/user/ws/GroupsAction.java
index b713e9a6ed2..df070a60d92 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/user/ws/GroupsAction.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/user/ws/GroupsAction.java
@@ -40,6 +40,7 @@ public class GroupsAction implements UsersWsAction {
private static final String PARAM_LOGIN = "login";
+ private static final String FIELD_ID = "id";
private static final String FIELD_NAME = "name";
private static final String FIELD_DESCRIPTION = "description";
private static final String FIELD_SELECTED = "selected";
@@ -110,6 +111,7 @@ public class GroupsAction implements UsersWsAction {
json.name("groups").beginArray();
for (GroupMembershipDto group : groups) {
json.beginObject()
+ .prop(FIELD_ID, group.getId().toString())
.prop(FIELD_NAME, group.getName())
.prop(FIELD_DESCRIPTION, group.getDescription())
.prop(FIELD_SELECTED, group.getUserId() != null)
diff --git a/server/sonar-server/src/main/resources/org/sonar/server/user/ws/example-groups.json b/server/sonar-server/src/main/resources/org/sonar/server/user/ws/example-groups.json
index ef1ca05b086..52a39b53438 100644
--- a/server/sonar-server/src/main/resources/org/sonar/server/user/ws/example-groups.json
+++ b/server/sonar-server/src/main/resources/org/sonar/server/user/ws/example-groups.json
@@ -3,7 +3,7 @@
"ps": 25,
"total": 2,
"groups": [
- {"name": "sonar-admins", "description": "Sonar Admins", "selected": false},
- {"name": "sonar-users", "description": "Sonar Users", "selected": true}
+ {"id": "2", "name": "sonar-admins", "description": "Sonar Admins", "selected": false},
+ {"id": "1", "name": "sonar-users", "description": "Sonar Users", "selected": true}
]
}