Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-11884

Filtering users by permission drops users depending on the page size

    XMLWordPrintable

Details

    Description

      Issue Summary

      When retrieving users who have a given permission (such as LICENSED_USER), either via REST (/rest/api/1.0/users) or the Java API (UserService.search with at least one included PermissionRequest on the UserSearchRequest), if the requested page size is greater than half the configured limit, users are dropped.

      By default, the configured limit for users (page.max.users) is 1000. That means requesting a page size greater than 500 results in dropped users.

      Steps to Reproduce

      1. Check licensed user count on the license screen
      2. Page over licensed users starting from /rest/api/1.0/users?permission=LICENSED_USER&limit=1000
      3. Observe that the total number of users returned via REST does not match the licensed user count

      Expected Results

      All users with the specified permission are returned.

      Actual Results

      A subset of the users are returned, with more or less dropped depending on the page size requested. (As in, requesting a page size of 501 will drop fewer users than requesting a page size of 1000.)

      Notes

      When retrieving users without filtering by permission, paging works without issue.

      Workaround

      Request a page size less than or equal to half the configured limit. By default, this means any page size of 500 or less will return all users. To allow requesting a larger page size, the configured limit must be raised to at least double the desired page size.

      Attachments

        Issue Links

          Activity

            People

              bturner Bryan Turner (Inactive)
              bturner Bryan Turner (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: