Restoring page from trash in personal space shows not permitted error for users with a space in their username

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Low
    • None
    • Affects Version/s: 6.15.6, 7.4.0
    • Component/s: Content - Page
    • None
    • 5
    • Severity 2 - Major
    • 1

      Issue Summary

      When using the restoretrashitem.action to restore a page, Confluence prompts a not permitted notification to user when an external LDAP is in play.

      Steps to Reproduce

      1. Installed Confluence v6.15
      2. Connected to Apache DS (any LDAP server will do)
      3. Created a (same) username with space in it and synced it to Confluence
      4. This user's personal space has a white space,
        • select spacename, lowerspacekey, spacetype from spaces where spacename like '%Pat%';
          
        • spacename   lowerspacekey spacetype 
          ----------- ------------- --------- 
          Pat Doe ~Pat Doe  personal  
          
      5. Created a page in personal space
      6. Deleted it
      7. Upon restore, got the same error!
      8. The issue didn't happen with other spaces
      9. Also, I renamed the user to without space,
      10. The issue still happened - because Space key is still the same. This also narrows down the cause to white space in Space Key

       

      Expected Results

      Page restored from trash.

      Actual Results

      Confluence prompts notification:
      Not permitted

      Workaround

      We can use the REST API to restore the page.

      1. Get the contentid for the deleted page.
        • We can get this from URL when attempting to restore the deleted page from trash
        • http://localhost:8090/pages/restoretrashitem.action?key=~admin&contentId=917510
          
      2. We need to find the version number for the body.
        • We can run this query against the database:
        • select * from content
          where contentid=917510;
          
        • We need to use the version column.
      3. Run this REST API:
        • PUT http://localhost:8090/rest/api/content/917510
          
          BODY
          {  "version":
          		{"number":2
          		},
          	"status": "current"
          }
          

            Assignee:
            Unassigned
            Reporter:
            Mark M (Inactive)
            Votes:
            4 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: