ASP.NET MVC Roles and Security
问题 Assume like this is my SampleController action method public ActionResult AdminView() { return View() } If want this controller method to be called if the logged in user belongs to admin role, otherwise this method call should be blocked and the user should get an some custom unauthorized access error page. In my asp .net mvc web application, when the user logs in, I am storing the user role in a session as a string. And whenever there is a need to validate the user role, I compare the value