in clientSecurity/src/main/java/org/apache/geode_examples/clientSecurity/Example.java [125:137]
private static void regionUserIsRestrictedByRegion() {
try (Example example = new Example("region1dataAdmin")) {
// This user can read and write only in region1
example.region1.put(AUTHOR_SANDERSON, BOOK_BY_SANDERSON);
String valueFromRegion = example.region1.get(AUTHOR_SANDERSON);
Validate.isTrue(BOOK_BY_SANDERSON.equals(valueFromRegion));
// This will fail since dataReader does not have DATA:WRITE:region2
example.region2.put(AUTHOR_SCALZI, BOOK_BY_SCALZI);
} catch (Exception e) {
logger.error("This exception should be caused by NotAuthorizedException", e);
}
}