On 02/17/2010 10:34 AM, PERINAUD Christophe wrote:
> Hi Stefan,
>
> Yes you can. In my case, based on a user, its group and its rights, i display 
> different links and pictures.
> It's easy to do in the source of the panel that you want to customize
>
> Ex:
>
> #if($xwiki.exists("BankingLexicon.WebHome"))
> <div style="margin-bottom: 
> ${marginbottom}px">{image:lexicon.png|align=absmiddle|document=Panels.QuickLinks}&nbsp;&nbsp;[Banking
>  lexicon>BankingLexicon.WebHome]</div>
> #end
>
> #if($xwiki.getUser().isUserInGroup("XWiki.GlobusAstreintes")&&  
> $xwiki.exists("Astreintes.WebHome"))
> <div style="margin-bottom: 
> ${marginbottom}px">{image:astreintes.png|align=absmiddle|document=Panels.QuickLinks}&nbsp;&nbsp;[Astreintes>Astreintes.WebHome]</div>
> #end
>
> You can also display or not a panel based on test :
>
> #if ($xwiki.hasAdminRights())
> #panelheader('Administrate')
> #set($marginbottom=3)
> <div style="margin-bottom: 
> ${marginbottom}px">{image:new.png|align=absmiddle|document=Panels.Administrate}&nbsp;&nbsp;[Create
>  new page/space>Panels.NewPage]</div>
> #panelfooter()
> #end
>
> If the user does not have admin rights, nothing will be displayed

Small clarification: all this is inside the panel, as it allows velocity 
code to be written in it. Any API method offered by XWiki can be used.

>
>> -----Message d'origine-----
>> De : users-boun...@xwiki.org [mailto:users-boun...@xwiki.org]
>> De la part de stefan bachert
>> Envoyé : mercredi 17 février 2010 10:05
>> À : users@xwiki.org
>> Objet : [xwiki-users] Panels
>>
>> Is there a way to set panels different per user capability?
>>
>> Stefan Bachert


-- 
Sergiu Dumitriu
http://purl.org/net/sergiu/
_______________________________________________
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users

Reply via email to