I am about to create my first proper application in ASP.NET MVC3.
It is basically a jobs site with 3 levels:
1) Users – No registration and can view all jobs posted on the website
2) Posters – Need to register and login to post adverts
3) Admin – Need to register and login to post adverts and review postings before they go live
Would you suggest I use the same Jobs controller for the three levels I mention above? With a LIST action to show jobs to “Users” and a CREATE & EDIT action for the “Posters” & “Admin”?
Thanks Paul
You should enable roles in your application and define 2 of them: ‘Admin’, ‘RegisteredUser’.
You then create 3 controllers.
1 for regular users
1 for Admins
1 for RegisteredUsers.
You can then secure your controllers as follows: