in src/main/java/org/apache/sling/resourceaccesssecurity/impl/AccessGateResourceWrapper.java [65:83]
public <AdapterType> AdapterType adaptTo(@NotNull Class<AdapterType> type) {
// we do not support the deprecated PersistableValueMap
AdapterType adapter = getResource().adaptTo(type);
if (adapter != null && !modifiable) {
if (type == ModifiableValueMap.class) {
adapter = null;
}
else if (type == Map.class || type == ValueMap.class) {
// protect also against accidental modifications when changes are done in an adapted map
adapter = (AdapterType) new ReadOnlyValueMapWrapper((Map) adapter);
}
}
// TODO: restrict reading of certain values
return adapter;
}