I don't think that is what he's getting at, I guess the real questions are:
1) why is option enablement not forwarded to the authorization strategy? 2) Is there a "blessed" way to no render options depending on authorization. Of course you can hack it, but you'll end up with your authorization code sprinkled around your project instead of a single point. Thomas > -----Original Message----- > From: Maurice Marrink [mailto:[EMAIL PROTECTED] > Sent: Mittwoch, 17. Oktober 2007 09:07 > To: [email protected] > Subject: Re: IAuthorizationStrategy and DropDownChoice > > Did you notice this method in AbstractChoice? > protected boolean isDisabled(final Object object, int index, > String selected) > > It is designed to do exactly what you want. In Wicket 1.3 > only, in wicket 1.2 you need to override protected void > appendOptionHtml(AppendingStringBuffer buffer, Object choice, > int index, String selected) and do it yourself. > > Maurice > > On 10/16/07, Jonas <[EMAIL PROTECTED]> wrote: > > While implementing a custom IAuthorizationStrategy for our > web app, I > > noticed that DropDownChoice (and any other AbstractChoice) doesn't > > honor restrictions on Component.RENDER and Component.ENABLE. > > > > Is there a recommended way to make that work? > > Wouldn't it make sense that AbstractChoice did honor those > > restrictions, as e.g. AbstractLink does? > > That would probably require an extension of the > IAuthorizationStrategy > > interface, since the selectable options are just any kind > of objects, > > not wicket components. Maybe a method like boolean > > isActionAuthorized(Component component, Object item, Action > action); > > would do the trick? > > > > > > Jonas > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
