private String createAccessFile() throws IOException {
    File file = tempFolder.newFile("jmxremote.access");
    BufferedWriter writer = new BufferedWriter(new FileWriter(file));
    writer.append("admin readwrite");
    writer.append(lineSeparator());
    writer.append("user readonly");
    writer.append(lineSeparator());
    writer.flush();
    writer.close();
    return file.getAbsolutePath();
  }
Test ReadOnly operations are accesible from RMI Connector with readOnly user
geode-core/src/integrationTest/java/org/apache/geode/management/internal/unsafe/ReadOpFileAccessControllerJUnitTest.java