boolean canRead;
synchronized (monitor) {
if (readCache.containsKey(id)) {
canRead = readCache.get(id);
} else {
ItemManager itemMgr = session.getItemManager();
NodeId nodeId = (isExistingNode) ? (NodeId) id : ((PropertyId) id).getParentId();
NodeImpl node = (NodeImpl) itemMgr.getItem(nodeId);
// TODO: check again if retrieving the path can be avoided
Path absPath = (path == null) ? session.getHierarchyManager().getPath(id) : path;
Result result = buildResult(node, isExistingNode, util.isAcItem(node), new EntryFilterImpl(principalNames, absPath, session));
canRead = result.grants(Permission.READ);