msyavuz commented on code in PR #43719:
URL: https://github.com/apache/superset/pull/43719#discussion_r3915181287
##########
superset-frontend/src/dashboard/components/SliceHeaderControls/index.tsx:
##########
@@ -196,13 +196,18 @@ const SliceHeaderControls = (
.get(props.slice.viz_type)
?.behaviors?.includes(Behavior.InteractiveChart);
const canExplore = props.supersetCanExplore;
- const { canDrillToDetail, canViewQuery, canViewTable } = usePermissions();
+ const { canDrillToDetail, canGetDrillInfo, canViewQuery, canViewTable } =
+ usePermissions();
+ // The dataset's verbose map resolves friendly Labels for both the
drill-to-detail
+ // pane and the "View as table" results grid, and those are separate
permissions —
+ // so fetch it for either one, as long as the drill_info endpoint itself is
+ // readable (it is gated by `can_get_drill_info` on Dataset).
const datasetResource = useDatasetDrillInfo(
props.slice.datasource,
props.dashboardId,
props.formData,
- !canDrillToDetail,
+ !canGetDrillInfo || !(canDrillToDetail || canViewTable),
Review Comment:
The menu item itself is gated on `canExplore || canViewTable` (line 602), so
a user with explore rights but neither `can_samples` nor
`can_view_chart_as_table` still opens the modal and sees raw names — worth
matching the two predicates?
##########
superset/datasets/schemas.py:
##########
@@ -518,6 +524,23 @@ def post_dump(
"""
Clear API response to avoid exposing sensitive information for
embedded users,
and filter columns to only include those with groupby=True for drill
operations.
+
+ ``metrics`` is deliberately not narrowed the same way. The two lists
answer
+ different questions: ``columns`` populates the drill-by dimension
picker, so
+ non-dimension columns are noise there, while ``metrics`` only ever
resolves
+ display labels (e.g. for the dashboard "View as table" results grid),
which
+ needs a label for every metric a chart may reference. Reusing the
dimension
+ filter on metrics would drop all of them, since a metric name is never
a
Review Comment:
`columns` is still narrowed to `groupby=True` below, and `createVerboseMap`
builds the map from that filtered list, so a raw-records table still shows raw
headers for its non-dimension columns — the same bug this PR fixes for metrics.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]