Hello friends,
I could potentially be posting this in the wrong forum, but be nice on me, I'm new.
I'm trying to build a website that allows different users to see different parts of site. At first, this might sound quite easy, as systems like EE, Wordpress and Joomla do this out of the box. However, all these systems use a Group Management system, which only allows one user to be in one group with one set of permissions.
I need to do this on an individual level. Meaning that a user can be in multiple groups, thus receiving multiple sets of permissions.
Here's an example:
Jake has access to
http://www.example.com/one
http://www.example.com/two
Maggie has access to
http://www.example.com/one
http://www.example.com/three
In both cases, Jake cannot access /three, Maggie can't access /two, and both of them can't access /four.
I've looked high and low for a CMS that can do this, but apart aMember Pro, I haven't found anything that is an all-in-one solution. Does anyone have any suggestions?
I've also considered coding this myself, and although I have my own ideas on how to implement this, I would like to hear ideas from the community.
Cheers!
Multiple User Permissions
Moderator: General Moderators
- social_experiment
- DevNet Master
- Posts: 2793
- Joined: Sun Feb 15, 2009 11:08 am
- Location: .za
Re: Multiple User Permissions
It seems rather counter-productive (and possibly code heavy) to give a user access to certain pages, rather than giving them access to certain sections.
Is there a need to use a system like the one you have in mind, i.e you MUST make it like this for a client?I need to do this on an individual level. Meaning that a user can be in multiple groups, thus receiving multiple sets of permissions.
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
- social_experiment
- DevNet Master
- Posts: 2793
- Joined: Sun Feb 15, 2009 11:08 am
- Location: .za
Re: Multiple User Permissions
It seems with a little thought this is possible.
Tables:
1.usertable - Contains the username, password and userid. [The 'userid' is the primary key for this table and a foreign key for 'leveltable']
2.pagetable - Contains the pagename, page and pageid. [The 'pageid' is the primary key for this table and a foreign key for 'leveltable']. The pageid is used to match which user can access which page (as per the userid assigned to it).
3.leveltable - Contains the pageid and userid. [These fields are foreign keys for pagetable and usertable respectively]. Each page that the user can access has the 'pageid' of that page in the level table. Along with the pageid is a 'userid' that corresponds to a specific user.
The process:
User logs onto the system, when a correct login has been achieved, the 'user_id' is selected from the table and the id is then checked against the pagetable.
All rows where usertable.user_id = leveltable.userid are selected, with the values of leveltable.pageid being stored in an array.
Loop through the array and select the pagename and page from pagetable, where
leveltable.pageid = pagetable.pageid. Place the selected pages in an array.
Loop through the array printing the links out for the specified user.
Hope this helps.
Tables:
1.usertable - Contains the username, password and userid. [The 'userid' is the primary key for this table and a foreign key for 'leveltable']
2.pagetable - Contains the pagename, page and pageid. [The 'pageid' is the primary key for this table and a foreign key for 'leveltable']. The pageid is used to match which user can access which page (as per the userid assigned to it).
3.leveltable - Contains the pageid and userid. [These fields are foreign keys for pagetable and usertable respectively]. Each page that the user can access has the 'pageid' of that page in the level table. Along with the pageid is a 'userid' that corresponds to a specific user.
The process:
User logs onto the system, when a correct login has been achieved, the 'user_id' is selected from the table and the id is then checked against the pagetable.
All rows where usertable.user_id = leveltable.userid are selected, with the values of leveltable.pageid being stored in an array.
Loop through the array and select the pagename and page from pagetable, where
leveltable.pageid = pagetable.pageid. Place the selected pages in an array.
Loop through the array printing the links out for the specified user.
Hope this helps.
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering