Site menu item for 'authenticated' users only

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

Site menu item for 'authenticated' users only

leconcombre
Hello,

I was wondering how I should implement a menu where some menu items are displayed only to authenticated users?

I already use the hst:authenticated attribute for those site map items but this does not prevent the menu option from showing up.

Thanks for your help!

Reply | Threaded
Open this post in threaded view
|

Re: Site menu item for 'authenticated' users only

leconcombre
I found a way to do this. Here's what I did since it might help someone else.

In the component rendering the menu, I converted the HstSiteMenu into a EditableMenu

Then I recursively navigated the items and removed the ones that the user could not access using code extracted from SecurityValve.checkAccess.