[AUTOMATED] Insert Include Macro with target document author [Since XWiki 14.10.2]

Last modified by Ilie Andriuta on 2024/06/27 16:33

Home CKEditor Home Run Test

Steps to reproduce

  1. Login as Admin
  2. Create a page (e.g. P1) containing a velocity macro (e.g.
    {{velocity}}
    #set($words = ["Some", "velocity", "code"])
    #foreach($word in $words)
      $word
    #end
    {{/velocity}}
  3. Login as a regular user (e.g. U1)
  4. Edit another page in CKEditor mode
  5. Click on "Insert" Button (the "+" icon)
  6. Click on "Other Macros"
  7. Search for "Include" and click Select
  8. In 'Page' drop-down, select the page created by Admin previously (e.g. P1)
  9. On 'Author' drop-down, make sure "Auto" is selected
  10. Click "Submit"
  11. Edit the "Include" macro again
  12. On 'Author' drop-down, select "Current"
  13. Click "Submit"
  14. Edit the "Include" macro again
  15. On 'Author' drop-down, select "Target"
  16. Click "Submit"

Expected results

Step 10 and Step 13 - An error is displayed on the macro:
"Failed to execute the [velocity] macro. Cause: [The execution of the [velocity] script macro is not allowed in [xwiki:P1.WebHome]. Check the rights of its last author or the parameters if it's rendered from another script.]. Click on this message for details."

This is due to the fact that "Auto" and "Current" settings enable the macro coming from the target page to be executed with the rights of the regular user (U1), while the target page was created and saved by Admin.

Step 16 - Although the current page (P2) is created by the regular user (U1), the content of the macro is executed with the rights of target document (Admin rights) and the content is displayed properly.

Automation Status

Automated

Results

per page of Page
Jira Issue
Warning
The environment prevents the table from loading data.
 
Page

Get Connected