0

Hi, after reading the good topics and contents on disaster to resolve the problems in recent years finally its my chance to signup :) and be the one to ask:

im working on a cms (not exactly) and stuck on menus and permissions. im wondering is there anyway the cms assign the menus by user permissions . for example user guest has this items (message, profile settings, article manager) but admin or root access has full items and this items will dynamically assigned to user.

im used this tutorial " a better login " and do some customize on it but not a chance to make what i wanted.

can you guys help me? Please

Edited by hamedx

4
Contributors
4
Replies
5
Views
5 Years
Discussion Span
Last Post by Robert1995
0

Hi,

You can do this by adding another column on your members database table. For example, we have a table member witht he following columns,

id --- username --- password --- other stuffs..

We can then modify the above to something like this

id -- username -- password --- privs -- other stuffs

You must then give a unique integer values for the privs for every member group.. for example 1 for regular member, 5 for the admin. This way you can easily sort out the content you want to show for specific group.

For the guest, all you have to do is validate that this person or browser is not logged in..

0

veedeoo thank you for reply let me check, ill be back

0

Further to veedeeo's suggestion. Using cumulative bits is quite effective, eg reg = 1, mod = 2, supermod = 4, admin = 8. So your nav items can then have a permission field like 15 for everybody; 12 for just supermods and admins; 8 for admins only. You check for a bit with the '&' operator. Just an idea.

0

Or create an extra table user_roles the user role table will be "extended" with another table role_permissions
Think this is a clean concept. And role_pemissions will have something like ... module, controller or action if your application is MVC
And another field permission_level, for example view/edit .Hope you get the ideea.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.