Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I determine Access Levels for menu items
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01238267
Message ID:
01238658
Views:
9
Hi,

>>FWIW, I noticed that this
>>		private void FilePad_DropDownOpening(object sender, EventArgs e)
>>		{
>>            this.FileLocalizeSetupBar.Visible = mmAppBase.Localize;
>>		}
>>
(and the following ListPad handler) in the sample app main form causes the menu item to be displayed even if it's access level dicates that it should not be shown. But I haven't discovered how I can modify it by programatically checking the menuitem's access level....
>
>We use an mmMenuStripExtender class to hold access levels for each menu strip item. This allows us to use the regular .NET menu strip items (and in turn the menu builder). If you examine the SetControlID() method (and set a breakpoint in it) you can see how it all works.


I'd looked through that (and have done so again) but the best I came up with is:
mmMenuStripExtender.SetControlID(this.LocalizeToolBar, mmMenuStripExtender.GetControlID(this.FileLocalizeSetupBar));
if (mmMenuStripExtender.AccessLevel == OakLeaf.MM.Main.Security.mmSecurityAccessLevel.Full){//etc}
which seems a bit convoluted...
Is there anything simpler?
Regards,
Viv
Previous
Reply
Map
View

Click here to load this message in the networking platform