private void checkCreatePermission(final DocRef folderRef, final String documentType) {
        // Only allow administrators to create documents with no folder.
        if (folderRef == null) {
            if (!securityContext.isAdmin()) {
                throw new PermissionException(securityContext.getUserRef(),
                        "Only administrators can create root level entries");
            }
        } else {
            if (!securityContext.hasDocumentCreatePermission(folderRef, documentType)) {
                final String folderName = Optional.ofNullable(explorerTreeModel.getModel().getNode(folderRef.getUuid()))
                        .map(ExplorerNode::getName)
                        .filter(name -> !name.isEmpty())
                        .map(name -> "'" + name + "' (" + folderRef + ")")
                        .orElse(folderRef.getName());
                throw new PermissionException(securityContext.getUserRef(),
                        "You do not have permission to create " + documentType + " in folder " + folderName);
            }
        }
    }
Create a map of folders and their child items.
stroom-explorer/stroom-explorer-impl/src/main/java/stroom/explorer/impl/ExplorerServiceImpl.java