3

I'm basically making a shopping cart in asp.net mvc. I'm adding an administrator section where the admins can:

  1. CRUD on Products.
  2. CRUD on Users.
  3. RUD on Orders.

Do I need to create an Administrator Area in the mvc project for admins, is it suited for my needs? What are the benefits of an Area?

smartcaveman
  • 41,281
  • 29
  • 127
  • 212
Shawn Mclean
  • 56,733
  • 95
  • 279
  • 406
  • This answer could be helpful: http://stackoverflow.com/questions/5343053/namespaces-equivalent-in-asp-net-mvc/5343105#5343105 – gideon Mar 20 '11 at 06:36

1 Answers1

4

You could use an Area. If your needs are likely to expand in the near future, then it might make sense. However, as of now your needs are fairly simple, and it seems like it would be easier to create a ProductController, a UserController and a RUDController, then apply an AuthorizationFilter to the "administrator" actions. I suggest you start this way, and if you need to add additional functionality in the future, then you can refactor the functionality to an Area. At this point, it would probably just be making unnecessary work for yourself.

EDIT: When I first started learning about MVC I read a blog post by Rob Conery that explained how to approach this problem. I just looked through my bookmarks and found it for you. I think you'll find it helpful: http://blogs.msdn.com/b/rickandy/archive/2011/05/02/securing-your-asp-net-mvc-3-application.aspx

Brian
  • 1,845
  • 1
  • 22
  • 37
smartcaveman
  • 41,281
  • 29
  • 127
  • 212