Navigation Provider: Show items only if not logged in

254 Views Asked by At

I search for a solution to hide menu items if a user is logged on within the navigation provider. A property for the obversely way is available: requiresAuthentication

Can anyone help me?

To inject the AbpSession within the navigation provider and check if AbpSession.UserId.HasValue doesn't work. I think the problem is that the navigation provider object is cached because the provider will not called on every request.

1

There are 1 best solutions below

0
On

yeah you are right. it's already cached. Why don't you do it in client side. You can create menu items in client-side. Use this namespace in javascript:

abp.nav.menus