Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-23648

Impossible to use RefactoringScriptService#restore(String batchId) directly if the author has programming right

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Critical
    • None
    • 10.10-rc-1, 10.8.2, 9.11.9
    • Refactoring
    • Easy

    Description

      For example, the following

      {{velocity}}
      #set ($batchId = "5cfabdc7-ecdd-49f3-90ba-a3fce03e0de2")
      $services.refactoring.restore($batchId)
      {{/velocity}}
      

      produces the error

      The author [null] of this script is not allowed to restore document [xwiki:Level1.WebHome()] with ID [11]
      

      The request is initialized with the current user, but not the author. When you don't have programming right, #execute() will reset the right, bit this time it does set the author (and fix the request).

      Same problem with the other #restore API and might be true with other methods of RefactoringScriptService.

      Attachments

        Activity

          People

            Unassigned Unassigned
            tmortagne Thomas Mortagne
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: