Furthermore, the fact that security sets a visible flag is an optimization to avoid double checking (we need the first check that might throw an exception before the actual rendering).
Eelco On 11/1/05, Igor Vaynberg <[EMAIL PROTECTED]> wrote: > Sure, but that makes it very easy for custom components to go around > security. For a tabbed panel for example an attribute modifier that adds a > disabled attr to the span has no effect. > > I also never said that the security will set the flag, all i proposed was to > take security into consideration when we /check/ the flag. If we dont then > any time we want to know if the component is really enabled we need to do > the dual check you mentioned above. > > -Igor > > > > On 11/1/05, Johan Compagner <[EMAIL PROTECTED]> wrote: > > isEnabled() on a component should just be there that developers can set or > unset. > > Then an attribute modifier is testing that flag to render the > disabled=disabled attribute > > or if it is a text component it can be another attribute modifier that > sets readonly=readonly and he also uses enabled for this > > so how enabled is interpreted is up to the developer/designer > > > > Security should not set the flags. They should only be a add on. And if my > vote goes to a attribute modifier > > Just set an attribute modifier who generates the disabled=disabled > attribute on > > > > comp.isEnabled() && security.allowEnabled() > > > > We should let the developer choose what he wants. He is the maker of > application > > > > johan > > > > > > > > On 11/1/05, Maurice Marrink <[EMAIL PROTECTED] > wrote: > > > I vote for 1 entry point. And I see nothing wrong with that being an > attributemodifier. Any isEnabled check should be asked at the > securitystrategy. > > > > > > ________________________________________ > > > > > > Maurice Marrink > > > > > > > > > > > > ________________________________________ > > > From: Igor Vaynberg [mailto: [EMAIL PROTECTED] ] > > > Sent: dinsdag 1 november 2005 2:26 > > > To: [email protected] > > > Subject: Re: [Wicket-develop] > iauthorizationpolicy.allowenabled() and component.isenabled > () > > > > > > I agree, we need a hook, but i dont think isEnabled is that hook. > > > Consider this: > > > if (component.isEnabled()) { component.setModelObject("blah"); } > > > this will throw a security exception if the component is enabled, but > auth policy overrides it. > > > > > > Auth policy disables a component before rendering. Ie invocation > handlers will not be allowed on a disabled object, etc. This isnt > implemented yet but will be in the future. > > > > > > -Igor > > > > > > > > > > > > On 10/31/05, Arto Arffman <[EMAIL PROTECTED]> wrote: > > > -1 if so, what's the hook for disabling things. > wicket.markup.html.link.Link is now bugged (cvs head) because it uses > setEnabled in onComponentTag(). Disabling should be done before rendering > and that is not allways possible. > > > 2005/11/1, Eelco Hillenius < [EMAIL PROTECTED]>: > > > Yeah, I tried to avoid breaking clients. Not the best idea however, so I > am > > > > > > +1 > > > > > > for folding it into a final isEnabled method. > > > > > > Eelco > > > > > > > > > On 10/31/05, Igor Vaynberg < [EMAIL PROTECTED]> wrote: > > > > Currently there is a slight disconnect between the way > Component.isEnabled () > > > > and the authorization policy work. The idea is to allow the policy to > > > > override the enabled state of component by returning false in > > > > allowEnabled(Component c) call, but in Component.isEnabled () we do > not check > > > > for this. > > > > > > > > This causes a problem because a call to Component.isEnabled() can > return > > > > true, while allowEnabled() for the same component will return false. > Imagine > > > > a situation where a component is a markupcontainer that has a few > children. > > > > These children want to set their visibility based on enabled/disabled > state > > > > of their parent. Currently the children would have to check both the > > > > component.isEnabled() and allowEnabled() of the policy - which is > > > > cumbersome. > > > > > > > > I propose adding the allowEnabled() check into the > Component.isEnabled() > > > > call and making it final to insure integrity. It would look like this: > > > > > > > > final boolean Component.isEnabled () { return > > > > > getFlag(ENABLED)&&getApplication().getPolicy().allowEnabled(this); > > > > } > > > > > > > > This change will however break some clients. isEnabled() is a pretty > common > > > > thing to put into your component and our Link component had it > introducded > > > > in 1.1. > > > > > > > > What are your thoughts/votes? > > > > > > > > -Igor > > > > > > > > > > > > > ------------------------------------------------------- > > > This SF.Net email is sponsored by the JBoss Inc. > > > Get Certified Today * Register for a JBoss Training Course > > > Free Certification Exam for All Training Attendees Through End of 2005 > > > Visit http://www.jboss.com/services/certification for > more information > > > _______________________________________________ > > > Wicket-develop mailing list > > > [email protected] > > > > https://lists.sourceforge.net/lists/listinfo/wicket-develop > > > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > This SF.Net email is sponsored by the JBoss Inc. > > > Get Certified Today * Register for a JBoss Training Course > > > Free Certification Exam for All Training Attendees Through End of 2005 > > > Visit http://www.jboss.com/services/certification for > more information > > > _______________________________________________ > > > Wicket-develop mailing list > > > [email protected] > > > > https://lists.sourceforge.net/lists/listinfo/wicket-develop > > > > > > > > > ------------------------------------------------------- SF.Net email is sponsored by: Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php _______________________________________________ Wicket-develop mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-develop
