Пример #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));
 }