in src/main/java/org/apache/sling/jackrabbit/usermanager/impl/resource/AuthorizableResourceProvider.java [179:220]
public Resource getResource(ResolveContext<Object> ctx,
String path,
ResourceContext resourceContext,
Resource parent) {
// handle resources for the virtual container resources
if (path.equals(systemUserManagerPath)) {
return new SyntheticResource(ctx.getResourceResolver(), path,
"sling/userManager");
} else if (path.equals(systemUserManagerUserPath)) {
return new SyntheticResource(ctx.getResourceResolver(), path, "sling/users");
} else if (path.equals(systemUserManagerGroupPath)) {
return new SyntheticResource(ctx.getResourceResolver(), path, "sling/groups");
}
AuthorizableWorker<Resource> authorizableWorker = (authorizable, relPath) -> {
Resource result = null;
// found the Authorizable, so return the resource
// that wraps it.
if (relPath == null) {
result = new AuthorizableResource(authorizable,
ctx.getResourceResolver(), path,
AuthorizableResourceProvider.this);
} else if (resourcesForNestedProperties) {
// check if the relPath resolves valid property names
Iterator<String> propertyNames = getPropertyNames(relPath, authorizable);
if (propertyNames.hasNext()) {
// provide a resource that wraps for the specific nested properties
result = new NestedAuthorizableResource(authorizable,
ctx.getResourceResolver(), path,
AuthorizableResourceProvider.this,
relPath);
}
}
return result;
};
// found the Principal, so return the resource
// that wraps it.
PrincipalWorker<Resource> principalWorker = principal -> new PrincipalResource(principal,
ctx.getResourceResolver(), path);
return maybeDoAuthorizableWork(ctx, path, authorizableWorker, principalWorker);
}