arturobernalg opened a new pull request, #556:
URL: https://github.com/apache/jspwiki/pull/556

   https://issues.apache.org/jira/browse/JSPWIKI-673
   
   Reading the ACL of a page renders the page, and rendering runs the page 
filters. A page filter that asks for the permissions of the page it is 
filtering, for example with AuthorizationManager.checkPermission in 
preTranslate, made DefaultAclManager.getPermissions render the page again, 
because the ACL of a page is only stored after the rendering ends. The result 
was a StackOverflowError: in a test with such a filter it came after 786 calls 
of the filter.
   
   getPermissions now remembers, per thread, the pages whose ACL it is reading, 
and returns an empty ACL when it is asked again for one of them. The outer call 
still reads and stores the real ACL. The difference is that a filter that runs 
during that reading sees an empty ACL for its page at that moment.
   
   DefaultAclManagerTest has a new test with a filter of that kind. It fails 
with a StackOverflowError without the change and passes with it. The whole 
jspwiki-main suite passes, 935 tests. I did not test the case of a filter that 
needs the real ACL of its own page during the first reading.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to