Click here to Skip to main content
15,882,209 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have created dynamic menu successfully. now I want to show/hide menu via userrights

Table 1 NewMenu (MenuId, MenuName, ParentId, IsActive, Content)

Table 2 UserRights (UserRightsId, UserId, Content, Add, Edit, Delete, View)
Posted
Comments
DamithSL 7-Sep-15 3:31am    
what is the relationship between table1 and table2? have you try to join two tables and take the menu items which having rights for logged in user? update the question with your sql statement which you tried so far
Sinisa Hajnal 7-Sep-15 4:40am    
What have you tried? What is the problem? Try creating menu already filtered by rights that way you don't have to have additional logic to hide after the creation what shouldn't be available in the first place.

1 solution

That is simple!

1- Make MenuId column primary key in your NewMenu Table
2- UserRightsId column should be foreign key to MenuId column, that is, This column should contain existing MenuIDs.
3- Write SQL Query to Select NewMenu table Join it to UserRights Table where UserRights.UserID = "CurrentUserid"

Hope that helps
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900