예제 #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);
  }
예제 #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);
 }