rebenitez1802 opened a new pull request, #45552:
URL: https://github.com/apache/superset/pull/45552

   ### SUMMARY
   
   Dashboard viewers and embedded guests who can view charts but cannot access 
their datasets see raw column and metric identifiers because the dashboard 
datasets API strips `verbose_map`. Return an additive per-chart 
`chart_display_labels` map (string chart ID → raw field/metric ID → string 
label, omitted when empty) and merge each authorized chart's labels into its 
rendering and cross-filter datasource, preserving existing full-access labels.
   
   Collect display references across visualization controls and saved query 
contexts using a shared extractor, with matching full-access trimming. Include 
configured stored names and explicitly authored adhoc labels; exclude filters, 
sort-only fields, expression internals, and semantic views. Existing metadata 
redaction remains intact. Each chart must belong to the requested dashboard and 
pass authorization. Guests additionally require that exact dashboard's grant 
and any dataset allowlist carried by their token; existing custom 
security-manager overrides remain effective.
   
   Permission work is lazy and request-local. On a nine-chart World Bank 
dashboard, the measured metadata-query counts are unchanged for guests (21 → 
21) and unlabelled Alpha requests (24 → 24). Nine labelled charts add one 
permission prefetch plus one check per chart for Alpha (24 → 36).
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   | Dashboard viewer without dataset access | Before | After |
   | --- | --- | --- |
   | Configured column display name | `country_name` | `Country` |
   | Configured saved metric display name | `sum__SP_POP_TOTL` | `Population` |
   | Unconfigured name | Original identifier | Original identifier |
   
   Verified through real guest-token API requests and plugin rendering tests; 
no browser screenshots are attached.
   
   ### TESTING INSTRUCTIONS
   
   1. Enable the existing `EMBEDDED_SUPERSET` flag for the embedded repro, or 
`ENABLE_VIEWERS` with `VIEWER_PROMISCUOUS_MODE` for the dashboard-viewer repro. 
Configure a SQL dataset column and saved metric with verbose names. Create 
table, pivot, pie, timeseries, or big-number charts referencing them and add 
them to a published dashboard.
   2. Open the dashboard as a permitted viewer without dataset access, or embed 
it using a guest token for that dashboard. Confirm chart headers/legends and 
cross-filter chips use the configured names.
   3. Inspect `/api/v1/dashboard/<id-or-slug>/datasets`: permitted chart IDs 
have string-only `chart_display_labels`; `verbose_map`, columns, and metrics 
stay redacted for restricted viewers.
   4. Restrict a chart to another viewer or exclude its SQL dataset from the 
guest token's allowlist. Confirm that chart contributes no labels. Full-access 
users retain their existing `verbose_map` behavior.
   
   Automated validation: 526 Python unit tests; 288 integration tests covering 
the complete dashboard API, guest-token security, and base API/OpenAPI suites; 
270 frontend tests; all eight authorization, extraction, redaction, and 
query-count mutation checks caught regressions. All applicable pre-commit hooks 
pass, including mypy, standard frontend TypeScript checking, and pylint. 
OpenAPI was regenerated under production-default configuration with only the 
additive property changed.
   
   ### ADDITIONAL INFORMATION
   
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [x] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [x] Introduces new feature or API
   - [ ] Removes existing feature or API
   
   No migration or new feature flag. Embedded verification uses the existing 
`EMBEDDED_SUPERSET` flag. Older clients can ignore the additive field; dataset 
metadata and drill/Explore permissions remain unchanged.
   


-- 
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]

Reply via email to