switch (type) {
case TreeTypeProvider.TYPE_HIDDEN:
// TODO: OAK-753 decide on where to filter out hidden items.
return true;
case TreeTypeProvider.TYPE_VERSION:
TreeLocation location = getVersionableLocation(tree, property);
if (location == null) {
// TODO: review permission evaluation on hierarchy nodes within the different version stores.
return compiledPermissions.isGranted(tree, property, permissions);
}
Tree versionableTree = (property == null) ? location.getTree() : location.getParent().getTree();
if (versionableTree != null) {
return compiledPermissions.isGranted(versionableTree, property, permissions);
} else {
return compiledPermissions.isGranted(location.getPath(), permissions);
}
default:
return compiledPermissions.isGranted(tree, property, permissions);
}
}