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