Display macro - permissions error for public page

In my main wiki I have public page (userguide). I want to include this page in public subwikis page. I use this display macro

{{display page=“mainwiki:Common/Userguide” /}}

This works when viewed by unregistered users, however logged subwiki user (local user) gets this error message: Failed to execute the [display] macro. Cause: [Current user [subwikiwiki:XWiki.SubwikiUser] doesn’t have view rights on document [Page mainwiki:Common/Userguide]].

Any clues why is that and how to fix this or how to solve that use case (to include common mainwiki pages in subwikis) ?

v12.9

Looks like https://jira.xwiki.org/browse/XWIKI-7434.

On trick in the way rights works in XWiki is that if you explicitly give view right to a user or a group at some level you also automatically deny it to others (except those having admin right at a higher level).

looks like that s the case. However I am pretty sure there are no restrictions whatsoever on the source (mainwiki) page - no permissions set as it is open wiki.

Maybe it s because subwiki local users? Is there any workaround for this? I need to have one page for userguide on main wiki and include it in all subwikis as subwiki page.

It does not seem to be possible to give rights to subwiki users on the main wiki right now.

To workaround it you could use some scripting to bypass the right check. Something like the following:

{{velocity}}
{{html clean="false"}}
$xwiki.getDocumentAsAuthor('xwiki:Common.Userguide.WebHome').getRenderedContent(true)
{{/html}}
{{/velocity}}
1 Like

great! That worked, Thank you!