Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Router BeforeNavigationEvent::reRouteToError #2356

Closed
pleku opened this issue Sep 8, 2017 · 0 comments
Closed

Router BeforeNavigationEvent::reRouteToError #2356

pleku opened this issue Sep 8, 2017 · 0 comments
Assignees
Milestone

Comments

@pleku
Copy link
Contributor

pleku commented Sep 8, 2017

Add following methods to BeforeNavigationEvent

void rerouteToError(Class<? extends Exception> clazz)
void rerouteToError(Class<? extends Exception> clazz, String errorMessage)
public class AuthenticationHandler implements BeforeNavigationListener {
  @Override
  public void beforeNavigation(BeforeNavigationEvent event) {
    Class<?> target = event.getNavigationTarget();
    if (!currentUserMayEnter(target)) {
      event.rerouteToError(AccessDeniedException.class);
    }
  }
}

Add a mention of this API to the documentation.

Waits for #2346

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants