xtasyarmada Posted December 12, 2008 Share Posted December 12, 2008 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! Quote Link to comment https://forums.phpfreaks.com/topic/136764-help-user-and-group-permissions/ Share on other sites More sharing options...
premiso Posted December 13, 2008 Share Posted December 13, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/136764-help-user-and-group-permissions/#findComment-714346 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.