Exemplo n.º 1
0
  @Transactional(readOnly = true)
  @Override
  public UserDetails loadUserByUsername(final String username) throws UsernameNotFoundException {

    final net.menu.model.User user = userDao.findByUserName(username);
    List<GrantedAuthority> authorities = buildUserAuthority(user.getUserRole());

    return buildUserForAuthentication(user, authorities);
  }
Exemplo n.º 2
0
 private User buildUserForAuthentication(
     net.menu.model.User user, List<GrantedAuthority> authorities) {
   return new User(
       user.getUsername(), user.getPassword(), user.isEnabled(), true, true, true, authorities);
 }