return EMPTY;
}
if (VersionConstants.VERSION_STORE_NT_NAMES.contains(ntName) || VersionConstants.NT_ACTIVITY.equals(ntName)) {
return new TreePermissionImpl(tree, TreeTypeProvider.TYPE_VERSION, parentPermission);
} else {
ImmutableTree versionableTree = getVersionableTree(tree);
if (versionableTree == null) {
log.warn("Cannot retrieve versionable node for " + tree.getPath());
return EMPTY;
} else {
/**
* NOTE: may return wrong results in case of restrictions
* that would match the path of the versionable node
* (or item in the subtree) but that item no longer exists
* -> evaluation by path might be more accurate (-> see #isGranted)
*/
while (!versionableTree.exists()) {
versionableTree = versionableTree.getParent();
}
TreePermission pp = getParentPermission(versionableTree, TreeTypeProvider.TYPE_VERSION);
return new TreePermissionImpl(versionableTree, TreeTypeProvider.TYPE_VERSION, pp);
}
}