Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

How to find user role by userid in mvc controller #2497


User avatar
0
hodor created

Hello,

I need to find logined user role by his / her id to display a specific menu item or not. Is there a built-in method for doing this or i should handle it by myself ? Can anyone lead me. Thanks.


2 Answer(s)
  • User Avatar
    0
    sergii created

    Good qustion, I've used userRoleRepository to do this

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    You can use UserManager's IsInRole method.