Hi,
We hope certain sections on a page are visible to certain users or groups but not visible by other users or groups. Does xwiki support this kind of functions? or is there any method we can take to achieve it?
Right system unit is the document in XWiki. Also a section is not really an entity, it’s just part of the page content.
You can always use scripting to limit access to some sections.
For example:
{{velocity}}
#if ($hasAdmin)
= Stuff for Admin only
#end
{{/velocity}}
But this means making impossible to edit this section separately.
Another option is to use the {{include}}
macro to include different sections and then use permissions on these pages. Only pages having the view right will be loaded by the include macro.
Hi, thanks.
I tried include macro or display macro as you said, the pages didn’t have the view right were not loaded by include macro, but there will be an err message box showed. Are there any parameters for the include or display macro not to show such err message box?
Hmm ok I’m surprised, I was expecting the include macro to silently ignore the include in these cases. It certainly used to work like this in the past. I’ll need to check it when I’m next in front of my computer.
Hi,
Using your way, together with include macro,
{{velocity}}
#if ($hasAdmin)
include macro here
#end
{{/velocity}}
I get what I need.
Really thanks.
Hi
I tried tmortagne’s method, and get what I want.
Thanks very much for help.