Path targetPath = getQPath(absPath);
boolean isGranted;
// The given abs-path may point to a non-existing item
if (itemExists(absPath)) {
ItemState itemState = getHierarchyManager().getItemState(targetPath);
isGranted = getAccessManager().isGranted(itemState, actionsArr);
} else {
NodeState parentState = null;
Path parentPath = targetPath;
while (parentState == null) {
parentPath = parentPath.getAncestor(1);
if (itemManager.itemExists(parentPath)) {
ItemState itemState = getHierarchyManager().getItemState(parentPath);
if (itemState.isNode()) {
parentState = (NodeState) itemState;
}
}
}
// parentState is the nearest existing nodeState or the root state.