Jump to content

User hierarchy database structure


lemmin

Recommended Posts

I am working on setting up a user hierarchy system for a website and I am considering two different ways of doing it.

 

The first way is to have one users table and separate tables for each different user type. To change a user's access rights, his/her user id is put into one of those separate tables. The second way is to only have the one users table and have a user type field where an integer id represents the access rights that the user has.

 

The benefit of using the first way is that it would be possible to store extra data that relates to that user type in the separate tables. This could get rid of some null fields in the user table. The benefit of using the second way is that the query could simply check if the user's type is greater than (or less than) a certain value and include multiple user types for access rights.

 

Does anyone else see any other benefits or downfalls of these two structures? Or, does anyone know of a better way other than these two ways to create a user hierarchy? Which way would you do it?

 

Thanks for any input.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.