XWIKI-9527: Sheets are not applied on preview action if the document is new
* Make sure programming rights are evaluated in preview mode based on the current user editing the document.
(cherry picked from commit 90ddb4055e69b89de67dee6453d7fb45b5c7b93e)