[SOLVED] Prohibit menu items from unauthenticated users

Topics: Customizing Orchard
Dec 13, 2011 at 9:02 PM
Edited Dec 13, 2011 at 9:04 PM

I don't want to show menu items for unauthenticated users.

I have a Navigation Widget with Styled Menu Widget inside. I set the Layer to Authenticated, but it still shows.

I edit the menu items in the Navigation section but see no way to prevent them from being shown to unauthenticated users.

help???

 

BTW, I'm using the Mango Theme

Coordinator
Dec 13, 2011 at 9:15 PM

What you are seeing is probably the old menu, which is not a widget. You'd need to edit it out in your theme.

Dec 13, 2011 at 9:58 PM

This is the code in the view:

@if (Model.Navigation != null)
{
    <div id="layout-navigation" class="group">        
        @Display(Model.Navigation)
    </div>
}

How would I limit this to only authenticated users?

Coordinator
Dec 13, 2011 at 10:34 PM

Oh, well, you could look at WorkContext.CurrentUser.

Dec 14, 2011 at 2:15 PM

Cool, that worked, thanks.

@if ((Model.Navigation != null) && (WorkContext.CurrentUser != null))
{
    <div id="layout-navigation" class="group">        
        @Display(Model.Navigation)
    </div>
}