I've created a razor page that is looping through all of the links on a site and displays a menu (which contains 7 items - one of which I've 'protected' by assigning a user role to it) and what I'm trying to do is hide this menu item if the person that's using the site isn't logged in.
@{ var child = CurrentPage.Site().Children.Where("Visible"); }
I would have thought that I could HasAccess but whereever I put this it completely hides all menu items.
Could someone point me in the right direction please?
Show only links where the user has access
Hi all,
I've created a razor page that is looping through all of the links on a site and displays a menu (which contains 7 items - one of which I've 'protected' by assigning a user role to it) and what I'm trying to do is hide this menu item if the person that's using the site isn't logged in.
I would have thought that I could HasAccess but whereever I put this it completely hides all menu items.
Could someone point me in the right direction please?
thanks, Craig
Hi Craig,
Try to see the documentation under the section member helpers https://our.umbraco.org/documentation/Reference/Querying/UmbracoHelper/
There you have these methods.
Hope this helps,
/Dennis
Good work, you know everything!
is working on a reply...