Menu Application - Hide when user doesn't have permissiont to view menu code.

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Menu Application - Hide when user doesn't have permissiont to view menu code.

DeHaynes
This post was updated on .
At my location we run a locked-down wiki for our operations manual. With the new Menu Application, when a user was unregistered, the Menu Application would throw an error on the Login screen. I was able to fix this by editing Menu.UIExtensionSheet in wiki mode. I changed one line for the horizontal menu. The vertical menus don't work on any of my wiki servers so I was not able to fix and test that. (See http://xwiki.475771.n2.nabble.com/Looking-for-Menu-Application-Bug-Verification-td7589735.html) Here is the line I changed:

Old
#set ($menuBar = "{{menu type=""horizontal fixedWidth""}}{{include reference=""$doc.prefixedFullName"" /}}{{/menu}}")

New
#set ($menuBar = "{{velocity}}
${escapetool.h}if (${escapetool.d}xwiki.hasAccessLevel(""view"", ${escapetool.d}xcontext.userReference, ""Menu.WebHome""))
{{menu type=""horizontal fixedWidth""}}{{include reference=""$doc.prefixedFullName"" /}}{{/menu}}
${escapetool.h}end
{{/velocity}}")

I hope this helps someone. :)
Reply | Threaded
Open this post in threaded view
|

Re: Menu Application - Hide when user doesn't have permissiont to view menu code.

Marius Dumitru Florea
See http://jira.xwiki.org/browse/XWIKI-10171 . Check the changes in
the Commits tab.

On Thu, Mar 20, 2014 at 7:58 PM, DeHaynes <[hidden email]> wrote:

> At my location we run a locked-down wiki for our operations manual.  With the
> new Menu Application when a user was unregistered, the Menu Application
> would throw an error on the Login screen.  I was able to fix this by editing
> Menu.UIExtensionSheet in wiki mode.  I changed one line for the horizontal
> menu. The vertical menus don't work on any of my wiki servers so I was not
> able to fix and test that. (See
> http://xwiki.475771.n2.nabble.com/Looking-for-Menu-Application-Bug-Verification-td7589735.html)
> Here is the line I changed:
>
> Old
>   #set ($menuPanel = "{{menu type=""vertical collapsible open""}}{{include
> reference=""$doc.prefixedFullName"" /}}{{/menu}}")
>
> New
>   #set ($menuPanel = "{{velocity}}
>     ${escapetool.h}panelheader(""$doc.plainTitle"")
>     {{menu type=""vertical collapsible open""}}{{include
> reference=""$doc.prefixedFullName"" /}}{{/menu}}
>     ${escapetool.h}panelfooter()
>     {{/velocity}}")
>
> I hope this helps someone.  :)
>
>
>
> --
> View this message in context: http://xwiki.475771.n2.nabble.com/Menu-Application-Hide-when-user-doesn-t-have-permissiont-to-view-menu-code-tp7589736.html
> Sent from the XWiki- Dev mailing list archive at Nabble.com.
> _______________________________________________
> devs mailing list
> [hidden email]
> http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________
devs mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/devs