[xwiki-users] Why showing items where no access?
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? -- View this message in context: http://www.nabble.com/Why-showing-items-where-no-access--tp16149729p16149729... Sent from the XWiki- Users mailing list archive at Nabble.com.
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
[Ricardo Rodríguez] wrote:
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
Hi Ricardo That sounds good. Does anybody mind if I make a JIRA entry (improvements) as I would like to see that feature in the default wiki? Cheers, Squirrel -- View this message in context: http://www.nabble.com/Why-showing-items-where-no-access--tp16163816p16197711... Sent from the XWiki- Users mailing list archive at Nabble.com.
squirrely_wrath wrote:
[Ricardo Rodríguez] wrote:
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
Hi Ricardo
That sounds good. Does anybody mind if I make a JIRA entry (improvements) as I would like to see that feature in the default wiki?
Nobody will get upset, the worst that could happen is that it will not be implemented as soon as you'd like. -- Sergiu Dumitriu http://purl.org/net/sergiu/
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... Sent from the XWiki- Users mailing list archive at Nabble.com.
participants (3)
-
[Ricardo Rodriguez] Your EPEC Network ICT Team -
Sergiu Dumitriu -
squirrely_wrath