diff options
author | James Moger <james.moger@gitblit.com> | 2013-11-16 09:46:55 -0500 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2013-11-26 16:07:04 -0500 |
commit | a7a0b8ea01dca14602fdb49047d987c36461e861 (patch) | |
tree | e7db370fc0230c627f54b0e6eef64f1282c591e7 /src/main/java/com/gitblit/wicket/GitBlitWebApp.java | |
parent | 718ae7b9f7970ea4475027c8ef91875c0bea5861 (diff) | |
download | gitblit-a7a0b8ea01dca14602fdb49047d987c36461e861.tar.gz gitblit-a7a0b8ea01dca14602fdb49047d987c36461e861.zip |
Refactor access to home page class
Change-Id: Ice5706dc0659a44f54e5bf29ca66580e3be22418
Diffstat (limited to 'src/main/java/com/gitblit/wicket/GitBlitWebApp.java')
-rw-r--r-- | src/main/java/com/gitblit/wicket/GitBlitWebApp.java | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/main/java/com/gitblit/wicket/GitBlitWebApp.java b/src/main/java/com/gitblit/wicket/GitBlitWebApp.java index 70aa1a6a..8cbda461 100644 --- a/src/main/java/com/gitblit/wicket/GitBlitWebApp.java +++ b/src/main/java/com/gitblit/wicket/GitBlitWebApp.java @@ -20,7 +20,6 @@ import java.util.Locale; import java.util.Map;
import org.apache.wicket.Application;
-import org.apache.wicket.Page;
import org.apache.wicket.Request;
import org.apache.wicket.Response;
import org.apache.wicket.Session;
@@ -31,7 +30,6 @@ import com.gitblit.GitBlit; import com.gitblit.Keys;
import com.gitblit.utils.StringUtils;
import com.gitblit.wicket.pages.ActivityPage;
-import com.gitblit.wicket.pages.BasePage;
import com.gitblit.wicket.pages.BlamePage;
import com.gitblit.wicket.pages.BlobDiffPage;
import com.gitblit.wicket.pages.BlobPage;
@@ -69,7 +67,7 @@ import com.gitblit.wicket.pages.UsersPage; public class GitBlitWebApp extends WebApplication {
- public final static Class<? extends BasePage> HOME_PAGE_CLASS = MyDashboardPage.class;
+ private final Class<? extends WebPage> homePageClass = MyDashboardPage.class;
private final Map<String, CacheControl> cacheablePages = new HashMap<String, CacheControl>();
@@ -81,7 +79,7 @@ public class GitBlitWebApp extends WebApplication { boolean useAuthentication = GitBlit.getBoolean(Keys.web.authenticateViewPages, false)
|| GitBlit.getBoolean(Keys.web.authenticateAdminPages, false);
if (useAuthentication) {
- AuthorizationStrategy authStrategy = new AuthorizationStrategy();
+ AuthorizationStrategy authStrategy = new AuthorizationStrategy(homePageClass);
getSecuritySettings().setAuthorizationStrategy(authStrategy);
getSecuritySettings().setUnauthorizedComponentInstantiationListener(authStrategy);
}
@@ -158,8 +156,8 @@ public class GitBlitWebApp extends WebApplication { }
@Override
- public Class<? extends Page> getHomePage() {
- return HOME_PAGE_CLASS;
+ public Class<? extends WebPage> getHomePage() {
+ return homePageClass;
}
public boolean isCacheablePage(String mountPoint) {
|