views:

201

answers:

1

Building an application, and there will be different levels of access.

What is the recommended way to restrict the display of navigation elements to those appropriate to the current user? Are there any built-in helper for this?

+1  A: 

I asked a similar question here. There are a few options, depending on your needs something as simple as checking User.Identity.IsInRole("xyz") in the view may suffice (not ideal, but it gets the job done).

If you have a complex navigation structure, the answers provided in my question maybe of use to you.

I should point out that as @casperOne has mentioned, the [Authorize] attribute will prevent unauthorized access to the actions in question, but will not help with the display of menu navigation to them.

Nate Bross