treeview at runtime with user rights
-
Hi there, We have a menu system built using the treeview control. All items of the menu are stored in an XML file and populate at runtime. I need to implement a new feature to this treeview control and its causing me to pull my hair out (not that I have much to pull out) I need to implement a user rights feature, where each page of the menu can be assigned to a user, if the user has that page, they see the menu structure etc. For example, if I have the following structure: Menu -Sub heading 1 --page 1 --page 2 --sub heading 2 ---page 3 ---page 4 -sub heading 3 --sub heading 4 ---page 5 User 1 has the rights to page1, page 3 and page 5 so his menu would be -sub heading 1 --page1 --sub heading 2 ---page 3 -sub heading 3 --sub heading 4 ---page 5 User 2 only has access to page3 and page 5 so their menu should be -sub heading 1 --sub heading 3 ---page 3 -sub heading 3 --sub heading 4 ---page 5 Getting the page access and finding user credentials isn’t an issue, but I’m really struggling to figure out some logic to generate the menu, keep the subheadings there if they are needed and not show anything that is blank. Has anyone done anything like this in the past? Any tips would be great, and code would be fantastic – but I’m really only looking for ideas on how to complete this. I’m sure I’m making it harder than it needs to, and I’m also sure loads of people have done this without a problem Thanks in advance
-
Hi there, We have a menu system built using the treeview control. All items of the menu are stored in an XML file and populate at runtime. I need to implement a new feature to this treeview control and its causing me to pull my hair out (not that I have much to pull out) I need to implement a user rights feature, where each page of the menu can be assigned to a user, if the user has that page, they see the menu structure etc. For example, if I have the following structure: Menu -Sub heading 1 --page 1 --page 2 --sub heading 2 ---page 3 ---page 4 -sub heading 3 --sub heading 4 ---page 5 User 1 has the rights to page1, page 3 and page 5 so his menu would be -sub heading 1 --page1 --sub heading 2 ---page 3 -sub heading 3 --sub heading 4 ---page 5 User 2 only has access to page3 and page 5 so their menu should be -sub heading 1 --sub heading 3 ---page 3 -sub heading 3 --sub heading 4 ---page 5 Getting the page access and finding user credentials isn’t an issue, but I’m really struggling to figure out some logic to generate the menu, keep the subheadings there if they are needed and not show anything that is blank. Has anyone done anything like this in the past? Any tips would be great, and code would be fantastic – but I’m really only looking for ideas on how to complete this. I’m sure I’m making it harder than it needs to, and I’m also sure loads of people have done this without a problem Thanks in advance
Look at TreeViewAdv on SourceForge. It has a 'mode' to pull node data on demand, and that appears what you are looking for. Hope it helps :)
**
xacc.ide-0.2.0.57 - now with C# 2.0 parser and seamless VS2005 solution support!
**