title: How can I restrict access to certain views and actions in MVC 5?
body: <p>I have three models named Category, Subcategory, and Service. Then, for each of them I created a controller using Entity Framework, which also creates views for them. So, for each of them I have separate Create, Delete, Edit, Details, and Index views. The point is that I have also added a property to my ApplicationUser class, that checks whether a user is admin or not. Namely, I have added this property:</p>
  
  <pre><code>public bool IsAdmin { get; set; }
  </code></pre>
  
  <p>So, the point is that, I want to check whether the user is admin or not, and act accordingly. If, user is admin, I want him/her to be able to view those views, and simply manipulate data (use the controllers), through those views. But, if he/she is not an admin, I want to show a message that he/she doesn't have authorization to view those pages and change the data. How can I achieve it in MVC? Is it possible?</p>