winforms - A user menu according to a Data Base role? -


NET), how can I provide a dynamically defined menu

Thank you in advance for sharing your support, time and your knowledge, it really helps.

Is there a guru out there?

You can find the IS_MEMBER ('role') using the T-SKL function that they have What's the role I'll probably wrap it in a stored procedure and bring back those roles about which I meditate about a set of records (i.e., all the roles user has care for me).

Then you just use the code:

  if (loginInntity.IsAdmin) {MenuItem adminMenu = new menu (); AdminMenu.Text = Resource Admin menu text; MainMenu.MenuItems.Add (adminMenu); Item = new menu item (); item. Text = resource Management user; Item.Click + = UserAdminClick; AdminMenu.MenuItems.Add (item); ...}  

Where you create your menu (My login entity object is calling a similar function here and sets me a bit variable about each role.) Code one Creates new upper menu (assuming that the main menu is already defined), and then a "user admin" item, all existing users believe that they play an administrator role (say, 'safety admin').


Comments