Hi,

squirrely_wrath wrote:
> Hi,
>
> Right now I'm just playing around with xwiki, so please forgive me if I
> missed the obvious solution/option to my question:
>
> Why is xwiki showing items to users who don't have the right to see the page
> anyway? Ie. the "Index" page or the "What's new" section. 
>
> Wouldn't it be better to show the user only things he can access, too? This
> way the "Index" page would make way more sense and the "What's new" section
> wouldn't show unimportant changes to the user (from his POV).
>
> WDYT?
>   

I think your idea makes sense, but it is not implemented in the way 
XWiki works by default. At least working with XE. Nevertheless, there is 
methods allowing you to do this for any entry you could find there. For 
instance:

This code coming from the Bulletin Application side column panel check 
if the current user has view rights in an item before showing it:

   #if($xwiki.getDocument($item).hasAccessLevel('view', $context.user) 
== 'true')
       #if ($xwiki.getDocument($item).getValue('bbtitle') != "")
           * [$xwiki.getDocument($item).display('bbtitle')>$item]
       #else
           * [$item]
       #end
   #end

In another wiki I've modified a copy of the menuview.vm macro put in its 
customized skin folder to be shown only to administrators. Simply add 
the same Velocity conditional structure #if/#end:

#if($context.getMode()==0)## Visible only in a page
#if ($xwiki.hasAdminRights())
****actual code****
#end
#end

Hope this helps,

Ricardo

-- 
Ricardo Rodríguez
Your EPEC Network ICT Team

_______________________________________________
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users

Reply via email to