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

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -