title: MVC4, Authorize Users based on User Table
body: <p>I am having an issue authorizing security on my MVC app. I see many people use AUTHORIZE, but I am not sure if that helps my problem if I am defining custom roles. I have a SQL table of Users and each user is assigned a role for my MVC app (e.g. Admin, Programmer, User), and their username is their windows user name. The windows username is grabbed when they go to my home page so they can only see their stuff and certain functions should be disabled (e.g. the delete ActionLink is disabled on the home page, a drop down box only populates certain value on the edit page). Right now I have a LINQ query checking the repository to see what type of user they are. Also, the admin and programmer should have access to one other special page that the User should not be able to access. </p>
  
  <p>Is the best design pattern to create two separate Index() / Edit() pages or create Html helper classes to disable / enable / hide ActionLinks and other controls? For the special page, how do I implement security to restrict unauthorized users? Thanks.</p>
  
  <p>EDIT: I found a great resource at <a href="https://github.com/NickKip/ASPNETCustomMembershipExample" rel="nofollow">https://github.com/NickKip/ASPNETCustomMembershipExample</a></p>