From ca0e9cf65d9f7e5bdcbebede29a89d47c5901068 Mon Sep 17 00:00:00 2001 From: alex-poor Date: Wed, 22 Apr 2026 11:14:15 +1200 Subject: [PATCH] fix(drill-detail): decouple copy button from download permission Copy was gated on canDownload, which hid the button for users who lacked export permission but could still legitimately use the clipboard. Gate Copy on canCopyClipboard (via usePermissions) and show the same permission-denied tooltip pattern used by the sibling Explore pane DataTableControls. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../Chart/DrillDetail/DrillDetailTableControls.tsx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/superset-frontend/src/components/Chart/DrillDetail/DrillDetailTableControls.tsx b/superset-frontend/src/components/Chart/DrillDetail/DrillDetailTableControls.tsx index c81f215d4cc..b31879719d2 100644 --- a/superset-frontend/src/components/Chart/DrillDetail/DrillDetailTableControls.tsx +++ b/superset-frontend/src/components/Chart/DrillDetail/DrillDetailTableControls.tsx @@ -30,6 +30,7 @@ import { Icons } from '@superset-ui/core/components/Icons'; import { Tooltip } from '@superset-ui/core/components'; import { CopyToClipboardButton } from 'src/explore/components/DataTableControl'; import { TabularDataRow } from 'src/utils/common'; +import { usePermissions } from 'src/hooks/usePermissions'; import DownloadDropdown from './DownloadDropdown'; export type TableControlsProps = { @@ -58,6 +59,7 @@ export default function TableControls({ columnNames, }: TableControlsProps) { const theme = useTheme(); + const { canCopyClipboard: copyEnabled } = usePermissions(); const filterMap: Record = useMemo( () => Object.assign( @@ -142,8 +144,18 @@ export default function TableControls({ onDownloadXLSX={onDownloadXLSX} /> )} - {canDownload && ( + {copyEnabled ? ( + ) : ( + + + + + )}