security - Help with asp.net mvc authorization -


You want to display a menu that contains several elements ... unique to the users with some element "administrator" role Are there. I know how to restrict controller methods that use

  [authorized (roles = "administrator")]  

user Specific HTML items

example

  & lt; Ul & gt; & Lt; Li & gt; Menu item 1 & lt; / Li & gt; & Lt;% // If the administrator is% & gt; & Lt; Li & gt; Menu item 2 (Admin only) & lt; / Li & gt; & Lt; / Ul & gt;  

How can I do this?

  and lieutenant; Ul & gt; & Lt; Li & gt; Menu item 1 & lt; / Li & gt; & Lt;% if (roles.isearer innerol ("administrator")) {%> & Lt; Li & gt; Menu item 2 (Admin only) & lt; / Li & gt; & Lt;%}% & gt; & Lt; / Ul & gt;  

Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -