public List<UserAuthority> getUserAuthorities(AclUser user) throws DataAccessException { List<UserAuthority> userAuthorities = null; if ((user.getUserMgrType() == null) || (user.getUserMgrType().intValue() != 1400)) { userAuthorities = userAuthorityRepository.findListByUser(user); } else { userAuthorities = new ArrayList(); List<Authority> authorities = authorityRepository.findAll(); for (Authority authority : authorities) { UserAuthority userAuthority = new UserAuthority(); userAuthority.setAuthority(authority); userAuthority.setSecurityuser(user); userAuthorities.add(userAuthority); } } if (userAuthorities == null) { throw new DataIntegrityViolationException( "user:"******" havn't userAuthorities"); } return userAuthorities; }