Posted on: 3/4/2014 6:02:00 PM | Views : 679

I have users with different Roles. I want to deliver restricted view according to roles of the users. I have something in my Code which checks roles:
bool isAdmin = UserManager.IsInRole(currentUser.Id,"admin"); bool isEmployee = UserManager.IsInRole(currentUser.Id,"employee"); For above code to work, I need to instantiate currentUser. In other words I need to catch the information of the current user that is logged in. I tried something like var user = User.Identity.GetUserId(); and many other but can't find the working code. I would appreciate any help. Thank you!

Go to the complete details ...