There is only one menu for all.but the menu contents must display dynamically.for example in the menu i have news,blogs,discussions etc if user1 is entered then (discussions) will not be there if user2 (blogs) will not be there.admin have privilages of changing the menu contents for the user if the admin change the previlage for one user then there is a table in database that stores the previlages for the users depends on the database contents the menu shold display for every user
I asume you have a table with user privileges, then other with all the menu options and finally other with privilege-menu_option.
In your servlet, or action in struts or the equivalent, you have to acces the table privilege-menu_option with the current user logged data. Set in Session the menu options for which the user have privileges and in your Jsp read the Session atribute to form the menu.
Generally user permissions are maintained by using Roles.
- Permissions are attached to Roles.
- Roles are attached to Users.
But from what I understood from ur problem, you do not have roles and Admin assigns permissions directly to Users. So may be now you have 3 tables: Users, Permissions, User_Permissions
Lets assume the following datastructures for ur Tables
Create 2 more tables:
Now its easy... After a user logs-in... Get user permissions from User_Permissions table. And then for all the permissionId's user has... fetch the Menu Items from Permissions_Menu and build the menu.