Is it possible to have different signIn pages for different roles? On 2/6/06, Jonathan Locke <[EMAIL PROTECTED]> wrote: > > okay, now it's just this: > > getSecuritySettings().setAuthorizationStrategy(new > IAuthorizationStrategy() > { > public boolean isAuthorized(Class pageClass) > { > // TODO Check session authentication and pageClass and return true or > false. > } > }); > > and > > getSecuritySettings().setSignInPage(MySignInPage.class); > > Begin forwarded message: > > From: Jonathan Locke <[EMAIL PROTECTED]> > Date: February 6, 2006 5:10:32 PM PST > To: wicket-develop@lists.sourceforge.net > Subject: remove Page.checkAccess() in 1.2? > > > > IAuthorizationStrategy is pretty darn easy to use and really suffers from > none of the problems you described. in your application's constructor you > would do something like this: > > getSecuritySettings().setAuthorizationStrategy(new > IAuthorizationStrategy() > { > boolean authorizeInstantiation(Class componentClass) > { > if (! <check-authorization(componentClass)>) // could be > annotations or instanceof equivalent or whatever > { > throw new RestartResponseAtSignInPageException(); > } > return true; > } > > boolean authorizeAction(Component component, Action action) > { > return true; > } > }); > > and you also have to register a sign in page class in your > ISecuritySettings. when the given component (Page in this case) > instantiation is attempted, the Component constructor will immediately call > your authorization strategy's authorizeInstantiation() method (before > anything significant has happened). You can return true or false, or you > can throw a RestartResponseAtSignInPageException, which > will redirect to a sign-in intercept page to allow the user to authenticate > themselves before continuing where they left off trying to access. > > if we want to make this super easy, we could create an Abstract base class > for this which lets you just implement the check and not worry about the > rest of it. in fact, i think i'll do that... ;-) > > jon > > > > >
------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642 _______________________________________________ Wicket-develop mailing list Wicket-develop@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-develop