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

Improper programming rights check on new documents that are created from templates

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • Major
    • None
    • 3.4
    • Old Core
    • Unknown

    Description

      Follow this steps to reproduce:

      1. Create a page that needs programming rights, e.g.:
        {{velocity}}
        $doc.document
        {{/velocity}}
        
      2. Create another page using the previous page as template:
        /xwiki/bin/edit/Spage/NewPage?editor=inline&template=Spage.PageTemplate
        

      The code from the template is not evaluated even if the current user has programming rights. Is this by design? The code says no, because debugging the rights service implementation reveals that:

      • the new document doesn't have the content author set (which is used to assert the programming rights); the content author is set only after the document is saved; moreover the content author is not null but the empty string
      • the method that asserts programming rights checks for null content author but since the content author is the empty string, it ends up asserting programming rights on "xwiki:XWiki.xwiki:" user which is clearly a bug.

      Attachments

        Activity

          People

            tmortagne Thomas Mortagne
            mflorea Marius Dumitru Florea
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: