0

Hi,

I am newbie.I have seen projects where there are menus or links below it which are accessible as per the profile set for the logged in users.If there are A,B,C,D menus in project then some group of user will have only A and B Menu when logged in..while other group of users might have A,D or any other elements as per the website elements checked in their assigned profile.Profile might have entire set of fields in projects.Is there any framework or approach or some way through which we can achieve this functionlaity.Thanks in advance. :)

2
Contributors
2
Replies
9
Views
1 Year
Discussion Span
Last Post by stupid guy
0

THis is a common feature for user groups / permissions. There are a number of scripts out there, but you could always roll your own. All you need is something like the following:

users

id | username | ... | usergroup_id

usergroups

id | label

menuitems

id | label | url | position | parent_id

usergroup_menuitems

usergroup_id | menuitem_id

That's assuming that you're storing the menuitems in a db table.

Otherwise, you can hard-code the visibility of items (not really recommended, but depends on the complexity, e.g. no. of different usertypes etc)

<ul id="nav">
    <?php if($usergroup > 0){ ?>
    <li>someparent</li>
    <?php } ?>
    ...etc...
</ul>
0

Thanks diafol! Looks like I was on right way.thanks for ur time n reply :) appreciate ur help..

This question has already been answered. 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.