Re: [xwiki-users] Why showing items where no access?

2008-03-21 Thread [Ricardo Rodriguez] Your EPEC Network ICT Team
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


Re: [xwiki-users] Why showing items where no access?

2008-03-21 Thread squirrely_wrath


Sergiu Dumitriu-2 wrote:
 
 
 Nobody will get upset, the worst that could happen is that it will not 
 be implemented as soon as you'd like.
 -- 
 Sergiu Dumitriu
 


Done:  http://jira.xwiki.org/jira/browse/XWIKI-2244 XWIKI-2244 

-- 
View this message in context: 
http://www.nabble.com/Why-showing-items-where-no-access--tp16163816p16202259.html
Sent from the XWiki- Users mailing list archive at Nabble.com.

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