Advertisement
Guest User

Untitled

a guest
Oct 17th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.56 KB | None | 0 0
  1.     protected void handle(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException {
  2.         String targetUrl = SecurityUtils.getStartPath(authentication);
  3.  
  4.         if (response.isCommitted()) {
  5.             return;
  6.         }
  7.  
  8.         Collection<? extends GrantedAuthority> authorities = authentication.getAuthorities();
  9.         if (authorities.contains(new SimpleGrantedAuthority("SUPERVISOR"))) {
  10.             redirectStrategy.sendRedirect(request, response, "/supervisor");
  11.         } else {
  12.             redirectStrategy.sendRedirect(request, response, targetUrl);
  13.         }
  14.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement