Correct. You can only test for the same thing that you can test for if you run the test inside the page factory - class or class name. ie boolean allowCreateComponent(Class c);
 
The advantage being that even if the page is created outside the pagefactory the security is applied.
 
-Igor
 
 
 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Johan Compagner
Sent: Wednesday, October 26, 2005 3:29 PM
To: wicket-develop@lists.sourceforge.net
Subject: Re: [Wicket-develop] integrating authorization

but what are you going test test there?
if you call in in the base class then almost nothing is constructed
So the only thing you can test is the class name itself that you are trying to construct.

Doing this:

class Base
{
    Base()
    {
          security.allowCreating(this);
    }
}

class Child extends Base
{

}

and then making new Child()
Then it security.allowCreation(this) in the base is very bad programming
Because you are giving the security implementation a object that is not yet constructed completely.

So allowCreation(Class) or allowCreation(String) is possible but not with the component itself.
If you call it in the constructor.



On 10/27/05, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> >> What is that allowCreation() ?
> >>  when whould that be called?
>
> >In the constructor of component.
> Too late, it needs to be checked on class level before
> calling any constructors. PageFactory would be a good start.

wicket.Component constructors are the first to be called whether you are
creating a page or component. Why is this too late?

Forcing users to use the page factory will limit the usefulness of the
framework, since anyone can do setResponsePage(new MyPage()); and get around
security checks in the factory.

-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
Wicket-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-develop

Reply via email to