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.
I’m not sure I’m completely clear on your situation, but…
If you want to efficiently make a list public, why don’t you just create an
IsPublicfield in your list table. Check that when the list is public. If a list IsPublic you don’t need to check for user specific rights.If you are concerned with too many rows in your user_list table, you can set it up with the fields:
UserID,ListID,CanEdit,CanReadI would only do that if the number of User rights is not likely to keep growing. And I’m not sure what the difference in performance will be.