Include username on GET Space Permissions REST API result

XMLWordPrintable

    • 2
    • 1

      Summary

      A set of new REST API for Space Permissions are introduced in Confluence 9.1, allowing admin to view, set, and revoke permissions for spaces:

      However, when sending a GET request to the endpoint below to retrieve a list of permissions granted for users and groups to a specific Space:

      <Base_URL>/rest/api/space/{spaceKey}/permissions
      

      The result for users are responded in the JSON format below:

      Sample Result
          {
              "operation": {
                  "targetType": "space",
                  "operationKey": "read"
              },
              "subject": {
                  "type": "group",
                  "name": "confluence-users"
              },
              "spaceKey": "PROJ",
              "spaceId": 131083
          },
      
          {
              "operation": {
                  "targetType": "space",
                  "operationKey": "read"
              },
              "subject": {
                  "type": "user",
                  "userKey": "4028800d98315ec60198315f45c00000"
              },
              "spaceKey": "PROJ",
              "spaceId": 131083
          },
      

      Despite the result for groups are returned with Group Name, the result for users are in userKey value, which is not easy for the admin to identify "who" the users are.

      Suggestion

      For user type responses, also include username value so that the REST API responses can also be consumed by admin/user without extra steps.

      Why this is Important

      As of now, there are extra steps required for admin to run in order to identify the user(s), which can become expensive when the list of useKey is long.
      Either via a REST API:

      Sample REST API for userKey
      <Base_URL>/rest/api/user?key=4028800d98315ec60198315f45c00000
      

      or a Database Query:

      Sample SQL Query
      ## for a single userKey
      select username from user_mapping where user_key='4028800d98315ec60198315f45c00000';
      
      ## for multiple userKey
      select username from user_mapping where user_key in ('4028800d98315ec60198315f45c00000','4028800d98315ec60198315f6caa000a');
      

            Assignee:
            Unassigned
            Reporter:
            Damien Tan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: