use of org.apache.wicket.authorization.strategies.page.AbstractPageAuthorizationStrategy in project wicket by apache.
the class AbstractBookmarkableMapperTest method newApplication.
@Override
protected WebApplication newApplication() {
return new MockApplication() {
@Override
protected void init() {
super.init();
getSecuritySettings().setAuthorizationStrategy(new AbstractPageAuthorizationStrategy() {
@Override
protected <T extends Page> boolean isPageAuthorized(Class<T> pageClass) {
if (pageClass == EmptyPage.class) {
throw new RestartResponseAtInterceptPageException(getHomePage());
}
return true;
}
});
}
};
}
use of org.apache.wicket.authorization.strategies.page.AbstractPageAuthorizationStrategy in project wicket by apache.
the class RestartResponseAtInterceptPageExceptionTest method newApplication.
@Override
protected WebApplication newApplication() {
return new MockApplication() {
@Override
protected void init() {
super.init();
getSecuritySettings().setAuthorizationStrategy(new AbstractPageAuthorizationStrategy() {
@Override
protected <T extends Page> boolean isPageAuthorized(Class<T> pageClass) {
if (pageClass != RedirectPage.class) {
RedirectPage intercept = new RedirectPage("http://example.com/path");
throw new RestartResponseAtInterceptPageException(intercept);
}
return true;
}
});
}
};
}
Aggregations