예제 #1
0
  @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;
  }
예제 #2
0
 @Override
 @Transactional(readOnly = true)
 public List<User> findAll(Specification<User> specification) {
   return userRepository.findAll(specification);
 }
예제 #3
0
 @Override
 @Transactional(readOnly = true)
 public List<User> findUserUniqueUsername(User instance) {
   return userRepository.findAll(UserSpecification.isUniqueUsername(instance));
 }