This issue has been created
There is 1 update.
 
 
XWiki Platform / cid:jira-generated-image-avatar-6d2f527d-fcdf-42c1-b692-422aaea1f94e XWIKI-25815 Open

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

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-5e7536e0-aca4-44fa-92bf-3c0f79eb04e8 Michael Hamann created this issue on 20/Nov/26 11:43
 
Summary: The details of a failed required rights analysis are empty in the edit confirmation
Issue Type: cid:jira-generated-image-avatar-6d2f527d-fcdf-42c1-b692-422aaea1f94e Bug
Affects Versions: 15.9-rc-1
Assignee: Unassigned
Components: Security - Required Rights
Created: 20/Nov/26 11:43
Priority: cid:jira-generated-image-static-major-8ddf80fe-4146-4415-b3b2-dccdaa23ff7e Major
Reporter: Michael Hamann
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.
 
 

1 update

 
cid:jira-generated-image-avatar-5e7536e0-aca4-44fa-92bf-3c0f79eb04e8 Changes by Michael Hamann on 20/Nov/26 11:52
 
Assignee: Michael Hamann