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

Document#rename(String newDocumentName, List<String> backlinkDocumentNames) does not check rights like #rename(String newDocumentName) does

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 2.0.1, 2.1 M1
    • 2.0, 1.9.4
    • {Unused} APIs
    • None
    • Unknown

    Description

      Here is a patch from Caleb James DeLisle

      Index: core/xwiki-core/src/main/java/com/xpn/xwiki/api/Document.java
      ===================================================================
      --- core/xwiki-core/src/main/java/com/xpn/xwiki/api/Document.java       (revision 24291)
      +++ core/xwiki-core/src/main/java/com/xpn/xwiki/api/Document.java       (working copy)
      @@ -2050,7 +2050,11 @@
           */
          public void rename(String newDocumentName, List<String> backlinkDocumentNames) throws XWikiException
          {
      -        this.doc.rename(newDocumentName, backlinkDocumentNames, getXWikiContext());
      +        if (hasAccessLevel("delete")
      +            && this.context.getWiki().checkAccess("edit",
      +                this.context.getWiki().getDocument(newDocumentName, this.context), this.context)) {
      +            this.doc.rename(newDocumentName, backlinkDocumentNames, getXWikiContext());
      +        }
          }
      
          /**
      

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: