@Override @Transactional(readOnly = true) public List<User> findAll() { List<User> resultList = new ArrayList<User>(); if (DilectuUtils.isAdministrator()) { resultList = userRepository.findAll(); } else { List<User> userList = findByTenant(TenantContextHolder.getTenant()); for (User user : userList) { if (!user.getGroup().getPermissions().contains(UserPermission.ADMIN)) { resultList.add(user); } } } return resultList; }
@Override @Transactional(readOnly = true) public List<User> findAll(Specification<User> specification) { return userRepository.findAll(specification); }
@Override @Transactional(readOnly = true) public List<User> findUserUniqueUsername(User instance) { return userRepository.findAll(UserSpecification.isUniqueUsername(instance)); }