design intranetsite with modules, database setup

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
lcidw
Forum Commoner
Posts: 58
Joined: Mon Apr 28, 2003 8:55 am
Location: Netherlands

design intranetsite with modules, database setup

Post by lcidw »

Right now i'm building an intranet site.

The site uses different modules, which could be a forum, or an article database.

Now here comes the problem.. The user has the right to view the forum, and view the article database, but the rights a user has on a module can differ per module. The forum as the rights [admin, mod, user, anonymous], the article database has the rights [editor, poster, anonymous].

Now, the right of these 2 modules differ only one.. but what if a module has 9 different rights?

I've set up the first concept of the database..

Code: Select all

USERS (userid, username, password)
USERS_MODULES (userid, moduleid, userlevel)
MODULES (modileid, modulename, active)
Here you see the problem, i can only assign one userlevel on a module per user, but what if a user on the forum has the right to post messages and is moderator? You could say userlevel = 3 or something.. but what if there are a lot of different rights..

Two things i came up with where making the userlevel a string with the rights in words, written with seperators..

Code: Select all

post|mod|view
another idea was to do it with the sum of digits:

Code: Select all

0, 1, 2, 4, 8, 16, 32..

21 = accesright 1 + 4 + 16
but this will get very blurry..

Now my question

ANYONE ANY IDEAS, PLEASE!
Post Reply