Jump to content

Recommended Posts

OK, so I am trying to create a very involved user system. Where users have their own profile pages and can see things that are relevant to them across the entire website. I need to assign roles to certain users.

For example:

 

Joe Snuffy logs in an sees news relevant to his groups. He clicks his the profile link and he can add or remove information, check his messages, his shoutboard, send requests to his superiors, etc.

 

Joe's Superior, aka Tom, logs in and sees news relevant to him and his group. He can view the members of his group and remove them, recommend them for promotion, view their profiles, add certain objects to their profile, add news that his subordinates can see, or remove older news topics. He also has the same permissions as Joe Snuffy.

 

Tom's Superior logs in and has things relevant to his level, and so on goes the chain of command, until you reach the admin who can view the website like Tom's superior's superior, but has another link added for him to go to the administrators area.

 

Now I am completely aware that this is fully capable, but am completely unaware how it is done or where to begin besides setting permissions to users and user groups.

 

So please a link or short description or something would help greatly.

 

Thanks!

Link to comment
https://forums.phpfreaks.com/topic/136764-help-user-and-group-permissions/
Share on other sites

Basically you have a field on your database called level. You set this when the user is created and then an admin can elevate their privelegs, say 1 is a registered and validated user, 2 is a superuser, 3 is a moderator and 4 is an admin.

 

When the user logs in you set in session their level. Then on the page depending on the level set in session you show them the right controls and allow them access to other areas of the site. If they do not have the proper level to view that page you let them know and redirect to a good page, such as index.

 

Hope that helps to get you going. 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.