|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Individuals Privileges W/ PHP
What I need is a user manager where I can assign users to specific categories that are pulled from a mysql database.
So instead of user groups I need "Individuals Privileges". Example: UserTwo is assigned to group "Authors". This means that UserTwo could post to any category. I need UserTwo to be assign to only post in the selected categories and not all of them. What I'm asking is what would be the best way to handle this? The user table does have a userLevel Id for groups, but I need to have more control on where they can post. Should I have another table called "Privileges", and this table would hold all the categories Id's that the user may post to? If So. How would the query look, Should I use JOIN? Then use explode for individual privileges? PHP Code:
|
|
#2
|
||||
|
||||
|
My question is, can a user be in two groups at once?
If the answer is yes, then you should have a seperate table containing different privilege levels. Since this is considered a many-to-many relationship (one user can have many privileges, and one privilege would apply to many users), you would need some sort of bridging table that links a user and their privilege. If a user can only have one privilege, then i'd simply store their privilege as a field in the user table. If you need any further information on Many to Many relationships, I found a simple, brief, explanation with example here: http://www.sum-it.nl/cursus/dbdesig...h/intro030.php3 |
|
#3
|
|||
|
|||
|
By default "Author" may post into all categories, I needed more control of where a specific User could post.
This way, Yes, I could choose more than one category a User could post in, but the user is still in the same group of "Authors" Additional Table - "privileges" userId | CatId | Edit | Delete | Post | 2 | 1 | X | X | 0 | This would say that userId of 2 could only post in category 1. The more I think about this the more I'm getting confused. So an additional table would be the best idea? Thanks for the reply MadCowDzz, I will check that out and see what I can do about this. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > Individuals Privileges W/ PHP |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|