DocumentTree menu shows hidden pages to some users

Hi,
I’m facing an issue with our Child Pages menu panel customization.
Some users can see “Preferences” pages as children of some nodes.
What’s strange is that it doesn’t happen with every user, in my case for example it works correctly (I am XWiki admin).
The user that is facing the error is only the admin of that project.
Could you please help us finding where can be the error?
Thank you.
This is the code:

Code

{{velocity}}
#panelheader(“MENU”)

#set ($openTo = $services.model.serialize($doc.documentReference, ‘default’).replaceAll(’([~"])’, ‘~$1’))

#set ($index = $openTo.indexOf(‘xwiki:’) +6)
#set ($index2 = $openTo.indexOf(’.’,16))
#set ($subb = $openTo.substring($index,$index2))
#set ($varr = $subb.concat(’.WebHome’))

{{documentTree showTranslations=“false” showAttachments=“false” compact=“true” showRoot=“true” openTo=“document:$openTo”
root=“document:xwiki:$varr” /}}
#panelfooter()
{{/velocity}}

Screenshot_1

This may be the case if this user has set this option in his user profile preferences?
grafik

@Devs: In my opinion, the majority of users does not need this option. There should be a way the prevent this? I guess you could remove it from the profile page template (?), but that is an overreaction and I myself as admin prefer to see all pages.

BR
Mario

Thank you very much for your tip… indeed this one was properly the case! :blush: