@SuppressWarnings({"rawtypes", "unchecked"})
  private MBeanServerConnection connectToRmiConnector() throws IOException {
    String serviceUrl = SERVICE_URLPREFIX + "//" + hostname + ":" + port + "/jmxconnector";
    String[] creds = {"user", "user"};
    Map env = new HashMap();
    env.put(JMXConnector.CREDENTIALS, creds);
    connector = JMXConnectorFactory.connect(new JMXServiceURL(serviceUrl), env);
    return connector.getMBeanServerConnection();
  }
Test ReadOnly operations are accesible from RMI Connector with readOnly user
geode-core/src/integrationTest/java/org/apache/geode/management/internal/unsafe/ReadOpFileAccessControllerJUnitTest.java