@Test
  public void postRegionKey() {
    // Test an unknown user - 401 error
    assertResponse(restClient.doPost("/" + REGION_NAME + "?key9", "user", "wrongPswd",
        "{ \"key9\" : \"foo\" }"))
            .hasStatusCode(401);

    // Test a user with insufficient rights - 403
    assertResponse(restClient.doPost("/" + REGION_NAME + "?key9", "dataRead", "dataRead",
        "{ \"key9\" : \"foo\" }"))
            .hasStatusCode(403);

    // Test an authorized user - 201
    assertResponse(restClient.doPost("/" + REGION_NAME + "?key9", "dataWrite", "dataWrite",
        "{ \"key9\" : \"foo\" }"))
            .hasStatusCode(201);
  }
Test permissions on deleting a region's key(s)
geode-assembly/src/integrationTest/java/org/apache/geode/rest/internal/web/RestSecurityIntegrationTest.java