List of usage examples for org.apache.wicket.authorization.strategies CompoundAuthorizationStrategy CompoundAuthorizationStrategy
CompoundAuthorizationStrategy
From source file:de.tudarmstadt.ukp.csniper.webapp.WicketApplication.java
License:Apache License
@Override public void init() { addResourceReplacement(WiQueryCoreThemeResourceReference.get(), theme); if (!isInitialized) { super.init(); getRequestCycleSettings().setTimeout(Duration.minutes(10)); getComponentInstantiationListeners().add(new SpringComponentInjector(this)); CompoundAuthorizationStrategy autr = new CompoundAuthorizationStrategy(); autr.add(new AnnotationsRoleAuthorizationStrategy(this)); autr.add(new MetaDataRoleAuthorizationStrategy(this)); getSecuritySettings().setAuthorizationStrategy(autr); mountPage("/login.html", getSignInPageClass()); mountPage("/analysis.html", AnalysisPage.class); mountPage("/evaluation.html", EvaluationPage.class); mountPage("/project.html", ProjectPage.class); mountPage("/type.html", AnnotationTypePage.class); mountPage("/statistics.html", StatisticsPage.class); mountPage("/statistics2.html", StatisticsPage2.class); // mountPage("/export.html", ExportPage.class); mountPage("/search.html", SearchPage.class); mountPage("/welcome.html", getHomePage()); // mountPage("/exportHtml.html", ExportHtmlPage.class); mountPage("/users.html", ManageUsersPage.class); isInitialized = true;/*from ww w .j a v a2s . co m*/ } }
From source file:dk.teachus.frontend.TeachUsApplication.java
License:Apache License
@Override protected void init() { if (getServletContext().getInitParameter("doDynamicDataImport") != null) { getDynamicDataImport().doImport(); }// www.j a va2s . co m // Settings CompoundAuthorizationStrategy authorizationStrategy = new CompoundAuthorizationStrategy(); authorizationStrategy.add(new TeachUsCookieAuthentication()); authorizationStrategy.add(new TeachUsAuthentication()); getSecuritySettings().setAuthorizationStrategy(authorizationStrategy); getApplicationSettings().setPageExpiredErrorPage(PageExpiredPage.class); getApplicationSettings().setInternalErrorPage(InternalErrorPage.class); getExceptionSettings().setUnexpectedExceptionDisplay(IExceptionSettings.SHOW_INTERNAL_ERROR_PAGE); getMarkupSettings().setStripWicketTags(true); if (getConfigurationType() == RuntimeConfigurationType.DEVELOPMENT) { getRequestCycleSettings().addResponseFilter(new AjaxServerAndClientTimeFilter()); } loadConfiguration(); mountPages(); mountResources(); }