In my first attempt at an MVC web application I have a fundamental question:
Suppose I have a webshop that has “articles”. The administrator of the site will have to view, add, edit and possibly delete these articles, so I guess I could create routings/URLs like this:
/articles/view/
/articles/add
/articles/edit/3
But viewing articles is not just for the administrator of the site, but also for the visitors. The most obvious URL wouls also be /articles/view/. So what is the best practice way of differentiating between URLs for the administrator and for the visitors? (and IS there a best practice way?) Should I do this:
/maintenance/articles/view – for the administrator
/articles/view – for the visitors
Or is it better to serve them the same URL and give them a different view, based on whether or not they are logged in or not?? Are there any specific advantages to using one over the other,or is it just convention?
Thanks,
Erik
It kinda depends on how your site is structured.
If you have a strict distinction between CMS (for site maintenance ) and public page, then your routes, most likely, will have completely different routing schemes for each part. They might even be mapping two separate applications.
On the other hand. If you want to create administration interface, which is integrated into the public site ( something along the lines of Inplace Editors ) then you will be using exactly the same routing scheme as public page, and your authorization level ( are you a visitor or admin ) will be determined on serverside.