Vladimir Nani
Vladimir Nani

Reputation: 2874

ASP.net adding row in database

I have a asp.net mvc3 web application. I have a list of items with images queried from db. From time to time I need to add new item to db and specify image. I'm thinking to add authentication and create special view only for admins for this purpose. Is it Ok?

What are the best practices for doing this? Thanks.

Upvotes: 0

Views: 71

Answers (1)

Reactor
Reactor

Reputation: 99

Best practices for this... Well lets see.

Answer some questions -

Q: Is manually adding the record via sql management console good enough along with manually uploading the file? A: Then no don't fix problems that don't exist

Q: Is this site publicly accessible? A: Then yes, authentication to post following all security guidelines for keeping script kiddies at bay,

And since your using ms mvc. Make use of the built in security attributes to control access to controller classes methods; for example; [Authorize(Roles = "Administrators")] ect, ect.

Should be fairly simple to set up;

  1. Edit web.config and turn on membership and roles, as well as login page
  2. Could possibly use the .net membership framework to hold users and roles
  3. Lock down controllers or methods with the [Authorize] attribute

Good luck,

Upvotes: 1

Related Questions