Tell me more ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

The database structure is like this : each user has create their list , and have a access right assign:

For example

table: user
attribute: UserID

table: list
attribute: ListID

table: user_list
attribute: ListID,UserID, Rights

There are two kind of rights :read , edit

Everything work fine until i have a rights call public ( everyone can edit) So that if i have 100 member with 10 list, i have to create 1000 userID - Rights: edit rows

that is incredibly increase in scale.

How to solve this:

1)Create separate table named public and put the ListID in it?

2) Store the row as ListID , null UserID, and with Rights 'Public'?

Which method is better? Thank you.

share|improve this question
1  

closed as off topic by jcolebrand Mar 2 '12 at 14:49

Questions on Database Administrators Stack Exchange are expected to relate to database administration within the scope defined in the FAQ. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about closed questions here.

2 Answers

I would suggest that you create a column for each of the rights read, edit, public so that you can assign the permissions for each user_list. When you get a new permission you add a new column and so on.

This makes it easy for you to check the permissions of a user on a specific list

share|improve this answer

I have a strong preference for your option 1 e.g.

table: user_public_list
attribute: ListID
share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.