On Feb 18, 2008, at 4:27 PM, [Ricardo Rodriguez] Your EPEC Network ICT
Team wrote:
Guillaume Lerouge wrote:
Hi,
have you tried something akin to
#if ($context.user == 'XWiki.YourUserName')
Test
#end
?
Nope. And it perfectly works! Thanks.
Given an user with this it is possible to control if a paragraph
appears
or not but a new doubt arises from here. Look at this...
#toc("2" "3" "")
#if ($xwiki.hasAdminRights())
1.1 Entry 1
1.1 Entry 2
#end
#if ($context.user == 'XWiki.MyUsername')
1.1 Entry 3
#end
Only Entry 1 and 2 are show in the document for an admin other than
MyUsername, but all three entries appear in the TOC.
Is it possible to control this? Thanks again!
This is a limitation of the TOC macro. It looks for 1.* text elements
in the raw document content. Thus there's no solution for this right
now apart from rewriting the TOC macro.
-Vincent