]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-6470 Add group ID in api/users/groups response
authorJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Wed, 3 Jun 2015 12:05:30 +0000 (14:05 +0200)
committerJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Wed, 3 Jun 2015 12:05:30 +0000 (14:05 +0200)
server/sonar-server/src/main/java/org/sonar/server/user/ws/GroupsAction.java
server/sonar-server/src/main/resources/org/sonar/server/user/ws/example-groups.json

index b713e9a6ed2ad44be9acf159997c3702e5d9ece6..df070a60d92a0ddfa4f39d343239021ee3ea2afc 100644 (file)
@@ -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)
index ef1ca05b086632c5ae51ea53d64c409e746c3dd1..52a39b53438e1d20f620a4ead5280b30c84e0503 100644 (file)
@@ -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}
   ]
 }