| | |
| | | import com.gitblit.Keys;
|
| | | import com.gitblit.models.UserModel;
|
| | | import com.gitblit.wicket.pages.BasePage;
|
| | | import com.gitblit.wicket.pages.RepositoriesPage;
|
| | |
|
| | | public class AuthorizationStrategy extends AbstractPageAuthorizationStrategy implements
|
| | | IUnauthorizedComponentInstantiationListener {
|
| | |
| | | @SuppressWarnings({ "unchecked", "rawtypes" })
|
| | | @Override
|
| | | protected boolean isPageAuthorized(Class pageClass) {
|
| | | if (RepositoriesPage.class.equals(pageClass)) {
|
| | | // allow all requests to get to the RepositoriesPage with its inline
|
| | | if (GitBlitWebApp.HOME_PAGE_CLASS.equals(pageClass)) {
|
| | | // allow all requests to get to the HomePage with its inline
|
| | | // authentication form
|
| | | return true;
|
| | | }
|
| | |
| | | public void onUnauthorizedInstantiation(Component component) {
|
| | |
|
| | | if (component instanceof BasePage) {
|
| | | throw new RestartResponseException(RepositoriesPage.class);
|
| | | throw new RestartResponseException(GitBlitWebApp.HOME_PAGE_CLASS);
|
| | | }
|
| | | }
|
| | | }
|