static boolean hasPermission(final SecurityContext securityContext,
                                 final ExplorerNode node,
                                 final Set<DocumentPermission> requiredPermissions) {
        if (requiredPermissions == null || requiredPermissions.isEmpty()) {
            return false;
        } else {
            return requiredPermissions.stream()
                    .allMatch(permission -> securityContext.hasDocumentPermission(node.getDocRef(), permission));
        }
    }
Some docRefs will get tested multiple times over the course of building the output tree
so hold a transient cache of filter matches. Also creates a combined predicate that only
includes the required checks bases on what is set in the ExplorerTreeFilter.
stroom-explorer/stroom-explorer-impl/src/main/java/stroom/explorer/impl/NodeInclusionChecker.java