Uploaded image for project: 'Service Packs and Hot Fixes'
  1. Service Packs and Hot Fixes
  2. MNT-19864

Rest API: "groups/{groupname} /members" endpoint does not honor more than 100 maxItems and pagination fails

    Details

      Description

      Summary
      While trying to retrieve ids from a group with over 800 user, sending a GET request to the following endpoint return only the first 100 members of the group. The maxItems parameter is not honored and pagination fails.

      /alfresco/api/-default-/public/alfresco/versions/1/groups/{groupId}/members?fields=id&maxItems=800
      

      Steps to reproduce
      1. Create a Group containing more than 100 users
      Send the GET request to the endpoint

      GET /alfresco/service/api/-default-/public/alfresco/versions/1/groups/{groupId}/members&maxItems=800
      

      For example:

      curl -X GET -uadmin:admin -H "Content-Type: application/json" http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/groups/GROUP_testgroup/members?fields=id&maxItems=800 
      

      Expected Behavior
      JSON should return ids of all the 800 group members.

      Observed Behavior
      There are over 800 user in the group, however, the endpoint only returns the first 100. Please refer to the supporting evidence

      Supporting Evidence

      curl -X GET --header 'Accept: application/json' -uadmin:admin 'http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/groups/GROUP_testgroup/members?fields=id&maxItems=800'
       
       { 
      {"list":{"pagination":{"count":100,"hasMoreItems":false,"totalItems":100,"skipCount":0,"maxItems":100},"entries":
      

      Workaround
      The other endpoint works.

      GET /alfresco/service/api/groups/{shortName}/children?authorityType={authorityType?}&maxItems={maxItems?}
      

      For example

      $ curl -X GET -uadmin:admin -H "Content-Type: application/json" "http://localhost:8080/alfresco/service/api/groups/testgroup/children?authorityType=USER&maxItems=800"
      
          "paging": 
          {
            "maxItems": 800,
            "skipCount": 0,
            "totalItems": 949,
            "totalItemsRangeEnd": null,
            "confidence": "exact"
          }
      

      Impact:
      Currently an external application for federated search using the end point /alfresco/api/default/public/alfresco/versions/1/groups/{group_name}/members

        Attachments

          Issue Links

            Structure

              Activity

                People

                • Assignee:
                  closedbugs Closed Bugs (Inactive)
                  Reporter:
                  tsalam Tareq Salam
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  8 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Structure Helper Panel