private void addModifyMenuItems(final List<Item> menuItems,
                                    final boolean singleSelection,
                                    final Map<ExplorerNode, ExplorerNodePermissions> documentPermissionMap) {
        final List<ExplorerNode> allItems = getExplorerNodeList(documentPermissionMap, false);
        final List<ExplorerNode> readableItems = getExplorerNodeListWithPermission(documentPermissionMap,
                DocumentPermission.VIEW,
                false);
        final ExplorerNode singleReadableItem = readableItems.stream()
                .findFirst()
                .orElse(null);
        final List<ExplorerNode> updatableItems = getExplorerNodeListWithPermission(documentPermissionMap,
                DocumentPermission.EDIT,
                false);
        final List<ExplorerNode> deletableItems = getExplorerNodeListWithPermission(documentPermissionMap,
                DocumentPermission.DELETE,
                false);

        // Actions allowed based on permissions of selection
        final boolean allowRead = !readableItems.isEmpty();
        final boolean allowUpdate = !updatableItems.isEmpty();
        final boolean allowDelete = !deletableItems.isEmpty();
        final boolean isInfoEnabled = singleSelection & allowRead;
        final boolean isRemoveTagsEnabled = updatableItems.size() > 1;

        // Feeds are a special case so can't be copied or renamed, see https://github.com/gchq/stroom/issues/3048
        final boolean hasFeed = readableItems.stream()
                .anyMatch(item -> FeedDoc.TYPE.equals(item.getType()));

        // Feeds are a special case so can't be renamed, see https://github.com/gchq/stroom/issues/2912
        final boolean isRenameEnabled = singleSelection
                                        && allowUpdate
                                        && !hasFeed;

        // Feeds are a special case so can't be copied, see https://github.com/gchq/stroom/issues/3048
        final boolean isCopyEnabled = allowRead && !hasFeed;

        final boolean wasAdded = addFavouritesMenuItem(menuItems, singleSelection, 10);
        if (wasAdded) {
            menuItems.add(new Separator(12));
        }

        menuItems.add(createInfoMenuItem(singleReadableItem, 20, isInfoEnabled, explorerListener));
        menuItems.add(createEditOrAddTagsMenuItem(updatableItems, 21, allowUpdate));
        if (updatableItems.size() > 1) {
            menuItems.add(createRemoveTagsMenuItem(updatableItems, 22, isRemoveTagsEnabled));
        }
        menuItems.add(createCopyMenuItem(readableItems, 23, isCopyEnabled));
        menuItems.add(createCopyAsMenuItem(allItems, readableItems, 24));
        menuItems.add(createMoveMenuItem(updatableItems, 25, allowUpdate));
        menuItems.add(createRenameMenuItem(updatableItems, 26, isRenameEnabled));
        menuItems.add(createDeleteMenuItem(deletableItems, 27, allowDelete));

        if (securityContext.hasAppPermission(AppPermission.IMPORT_CONFIGURATION)) {
            menuItems.add(createImportMenuItem(28));
        }
        if (securityContext.hasAppPermission(AppPermission.EXPORT_CONFIGURATION)) {
            menuItems.add(createExportMenuItem(29, readableItems));
        }

        if (singleSelection) {
            if (readableItems.size() == 1) {
                // Only need VIEW to see the deps
                final DocRef docRef = readableItems.get(0).getDocRef();
                menuItems.add(new Separator(30));
                menuItems.add(createShowDependenciesFromMenuItem(docRef, 31));
                menuItems.add(createShowDependantsMenuItem(docRef, 32));
            }

            final List<ExplorerNode> ownedItems = getExplorerNodeListWithPermission(documentPermissionMap,
                    DocumentPermission.OWNER,
                    true);
            if (ownedItems.size() == 1) {
                // Only allow users to change permissions if they have a single item selected.
                final DocRef docRef = ownedItems.get(0).getDocRef();
                menuItems.add(new Separator(33));
                menuItems.add(createPermissionsMenuItem(docRef, 34, true));
            }
        }
    }
Highlights the supplied document item in the explorer tree.
stroom-core-client/src/main/java/stroom/document/client/DocumentPluginEventManager.java