Create Space v1: permissions array breaks with Roles experience enabled

XMLWordPrintable

    • 2
    • Severity 3 - Minor
    • 1
    • Warranty

      Issue Summary

      If a Confluence Cloud site has the new roles experience enabled, attempts to create a space using the v1 endpoint fails if the payload contains data that defines permissions to that new space during its creation.

      Steps to Reproduce

      1. Enable the Roles feature preview.
      2. Using the v1 Create Space endpoint, attempt to create a space. In the payload of the request, we need to send the permissions array:
        {
          "key": "newTest0223",
          "name": "newTest0223",
          "description": {},
          "permissions": [
            {
              "subjects": {
                "user": {
                  "results": [
                    {
                      "type": "user",
                      "accountId": "USER-ID"
                    }
                  ],
                  "size": 1
                }
              },
              "operation": {
                "operation": "create",
                "targetType": "blogpost"
              },
              "anonymousAccess": false,
              "unlicensedAccess": false
            }
            ]
        }
        

      Expected Results

      The space is created with the permissions defined in the request.

      Actual Results

      Space creation fails. The request receives a 500 response with the following error:

      {
          "statusCode": 500,
          "message": "org.springframework.dao.DuplicateKeyException: A different object with the same identifier value was already associated with the session : [com.atlassian.confluence.spaces.SpaceDescription#54198273]; nested exception is org.hibernate.NonUniqueObjectException: A different object with the same identifier value was already associated with the session : [com.atlassian.confluence.spaces.SpaceDescription#54198273]"
      }
      

      Workaround

      Currently, the only known workaround is to remove the space permissions array from the payload and set the permissions in a separate request.

              Assignee:
              David Skudra
              Reporter:
              Lucas Bugs
              Votes:
              16 Vote for this issue
              Watchers:
              14 Start watching this issue

                Created:
                Updated: