code: private boolean isPanelUser(JdbcConnection connection, Long panelId, String email) throws CustomChangeException {
      try (PreparedStatement statement = connection.prepareStatement("SELECT id FROM PANELUSER WHERE panel_id = ? AND user_id = (SELECT id FROM USEREMAIL WHERE address = ?)")) {
        statement.setLong(1, panelId);
        statement.setString(2, email);
        
        try (ResultSet resultSet = statement.executeQuery()) {
          return resultSet.next();
        }
      } catch (Exception e) {
        throw new CustomChangeException(e);
      }
    }
docs: Returns whether user by email is a PanelUser or not
  
  @param connection connection
  @param panelId panel id
  @param email email
  @return whether user by email is a PanelUser or not
  @throws CustomChangeException on error