Microsoft SQL Server
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft SQL Server

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old September 1st, 2004, 08:40 AM
zkent zkent is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 3 zkent User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
User Accounts best practices

I am fairly new to .net and SQL server. I am creating a c# web app that will require several types of logins (general users, administrators, etc) and the app will contain of said logins (especially the general user). This is a pretty typical web app so my typical user will have an account with a profile that they can update online and they will only have access to their own account, etc.

Q: is it better 1) to create tables of my own to contain the user accounts and another table to define their permissions or 2) utilize SQL server's built in user tables, roles, and permissions? I could end up with thousands of active users so before I begin coding I want to make sure I am doing this right.

TIA

Reply With Quote
  #2  
Old September 1st, 2004, 09:29 AM
Memnoch's Avatar
Memnoch Memnoch is offline
Unholy Moderator
ASP Free God 14th Plane (11500 - 11999 posts)
 
Join Date: Oct 2003
Location: In hell, where did you think?
Posts: 11,770 Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 3 Weeks 5 Days 7 h 8 m 6 sec
Reputation Power: 469
I would create a users table and a security table, similar to this
Quote:
Security Table
sId int (Identity or GUID) PK
securityLevel varchar(20)


Users Table
uId int (Identity or GUID) PK
Username
Password
SecurityLevelID (int or GUID) FK to Security Table


Last edited by Memnoch : September 1st, 2004 at 09:33 AM.

Reply With Quote
  #3  
Old September 1st, 2004, 09:41 AM
zkent zkent is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 3 zkent User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Blunder #1?

Yeah after I posted I found an article called "Top 10 SQL Server Blunders" and I believe the question I posed is Blunder #1. http://searchdatabase.techtarget.com/tip/1,289483,sid13_gci874688,00.html?FromTaxonomy=%2Fp r%2F286331Am I reading it right? I am NOT supposed to use built-in user accounts for my application?

Reply With Quote
  #4  
Old September 10th, 2004, 09:05 AM
Paula Paula is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 65 Paula User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 37 m 32 sec
Reputation Power: 5
Quote:
Originally Posted by zkent
Yeah after I posted I found an article called "Top 10 SQL Server Blunders" and I believe the question I posed is Blunder #1. http://searchdatabase.techtarget.co...2Fp r%2F286331Am I reading it right? I am NOT supposed to use built-in user accounts for my application?

I find this really strange. I'm also fairly new to SQL server but from what I can see (and I've been looking into it), sql server provides great security features. I would set up each role I required as a group, and add people as necessary to the role. The role would have the permissions so that I didn't need to change individual's permissions all the time. That saves time and space. It sounds really odd to me to create your own security tables when sql server has it all there for you. You can even create separate log ins for different applications, so that a person only has access to your database from within a certain application. You can also create views and stored procedures, and apply permissions to those for certain groups, so you can specify which columns on which tables your users have access to. It's really flexible.

Reply With Quote
  #5  
Old September 10th, 2004, 09:10 AM
Memnoch's Avatar
Memnoch Memnoch is offline
Unholy Moderator
ASP Free God 14th Plane (11500 - 11999 posts)
 
Join Date: Oct 2003
Location: In hell, where did you think?
Posts: 11,770 Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 3 Weeks 5 Days 7 h 8 m 6 sec
Reputation Power: 469
That's a good idea in certain environments Paula, the only drawback would be if the client wanted an adminstrative side to the application to manage the users permissions.

Setting it up in tables would allow Adminstrators to manage user permissions as needed.

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft SQL Server > User Accounts best practices


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT