Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-9287

Permission is missing for some users in api/permissions/users when there's more than 20 permissions

    Details

      Description

      Context

      When the number of user permissions returned by api/permissions/users is greater than 20, only 20 permissions will be returned.

      Example

      The query http://localhost:9000/api/permissions/users?projectKey=MyProject&ps=100&organization=default will return :

      {
        "paging": {
          "pageIndex": 1,
          "pageSize": 100,
          "total": 6
        },
        "users": [
          {
            "login": "user1@github",
            "name": "User 1",
            "permissions": [
              "admin",
              "codeviewer",
              "issueadmin",
              "scan",
              "user"
            ]
          },
          {
            "login": "user2@github",
            "name": "User2",
            "permissions": [
              "admin",
              "codeviewer",
              "issueadmin",
              "scan",
              "user"
            ]
          },
          {
            "login": "user3@github",
            "name": "User 3",
            "permissions": [
              "admin",
              "codeviewer",
              "issueadmin",
              "scan",
              "user"
            ]
          },
          {
            "login": "user4@github",
            "name": "User 4",
            "permissions": [
              "admin",
              "codeviewer",
              "issueadmin",
              "scan",
              "user"
            ]
          },
          {
            "login": "user5@github",
            "name": "User 5",
            "permissions": [
              
            ]
          }
        ]
      }
      

      Technical detail

      The user permissions are loaded in permissions.UsersAction#findUserPermissions by using UserPermissionDao#select which is using pagination (default page size is 20) => the pagination should be disabled here in order to get all user permissions.

        Attachments

          Activity

            People

            • Assignee:
              julien.lancelot Julien Lancelot
              Reporter:
              julien.lancelot Julien Lancelot
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Due:
                Created:
                Updated:
                Resolved: