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

Wrong context usage in the Query plugin

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 2.0.4, 2.1 RC1
    • 1.9.4
    • {Unused} Core
    • None
    • patch
    • Unknown

    Description

      The almost unmaintained query plugin was written without respect to the rules that the plugin is a singleton and the plugin API is an instance to be used in the current context.

      Both the API and plugin where using the same context, that was the initial context of the plugin singleton instance. This is obviously wrong, but works pretty well in an XE (not a XEM). The API functions were doing rights checking but on the wrong context.

      Without breaking current behaviour, the attached patch fix the context usage and deprecate the wrong usage. This will ensure no breakage in current code that was using the broken version of the plugin itself (not the API) or event those who gets the API manually (not using the plugin dedicated function).

      It also adds the hability for authors with programmings rights, to skip rights checking which is the equivalent to using the plugin directly but now with the appropriate context for access to databases objects in a XEM.

      Note that we have used the broken plugin successfully under XEM 1.2 (based on XE 1.4) and that was a migration to 1.9 that has reveal this issue. I have not found valid explanation for that !

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: