asp.net mvc - How to Customize Bootstrap 3 Navigation Menu based on Identity 2 User Role? -


i've created asp.net web application using identity 2 , have defined several roles. role based authorization in place. controller class action methods have been decorated authorize commands specifying roles can use controller method.

at point, need customize bootstrap 3 navigation menu administrators see menu options, members of role see theirs etc. in day, used use sitemap membership provider unsure how in plain ole mvc 5. guidance appreciated!

you can use user.isinrole() render links conditionally.

@if (user.isinrole("admin")) {          @html.actionlink("admin dashboard", "index", "dashboard") }  

this might help.


Comments

Popular posts from this blog

How to check data type in C++? -

javascript - Is getTimezoneOffset() stable during daylight saving transition? -

sql server - SQL Query returns one result, does not return 0 or NULL result -