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

The details of a failed required rights analysis are empty in the edit confirmation

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 15.9-rc-1
    • None
    • Unknown

    Description

      When the required rights analysis fails while opening an editor, the edit confirmation displays "An error occurred during the required rights analysis.", but clicking it shows empty details, and the exception is not logged either: the cause of the failure is lost.

      Cause

      RequiredRightsEditConfirmationChecker catches the RequiredRightsException of the analysis and exposes it to the security/requiredrights/requiredRightsEditConfirmationCheckerError.vm template as a script binding named exception, which the template passes to #displayException. But exception is a reserved Velocity binding (used by the #try directive), which ScriptVelocityContext never copies from the script context into the Velocity context, whatever its scope. So $exception is never set in the template, $exceptiontool.getStackTrace($exception) returns an empty string, and the details box is empty.

      exception has been a reserved binding since XWIKI-13558 (8.3), so this never worked since the checker was introduced in XWIKI-21311. Confirmed on stable-18.10.x by evaluating [$exception] [$analysisResults] through DefaultVelocityManager with both bindings in the script context, in the engine and in the global scope: the output is [$exception] [the results].

      Proposed fix

      • Expose the exception to the template under a non-reserved name (e.g. requiredRightsException) and use it in requiredRightsEditConfirmationCheckerError.vm.
      • Log the exception in RequiredRightsEditConfirmationChecker, so that the cause is also available to administrators.

      Attachments

        Issue Links

          Activity

            People

              MichaelHamann Michael Hamann
              MichaelHamann Michael Hamann
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: