
December 3rd, 2002, 05:11 PM
|
|
Contributing User
|
|
Join Date: Jul 2002
Posts: 155
Time spent in forums: 6 h 6 m 5 sec
Reputation Power: 11
|
|
|
table design question
Hi all. Here's the situation. I'm building a CMS which will be serving content from a database, and I'm trying to figure out the best way to restrict user access to specific content in the database.
Here's the tables which need to be considered here:
cms_groups (holds group_id and name)
cms_users (holds user_id, group_id, and other info)
cms_areas (holds area_id and name)
cms_content (holds content_id, area_id, and other info)
Now, I was thinking that I would create another table, cms_access, which would have four columns,
- area_id
- content_id
- user_id
- group_id
Then for each page or directory which I wanted to protect, I would just have a record added with an associated user and/or group id.
From here when a user was logged in and needed a listing of all content which they can access, I would hit a view which pulled the content and areas for each specific user, based on what they were given access to in the cms_access table.
Does this seem to be a feasible solution? Can anyone offer any advice as to how it could be improved?
Thanks in advance,
Pablo
|