Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I determine Access Levels for menu items
Message
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
01238267
Message ID:
01238658
Vues:
8
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform