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

   ### SUMMARY
   
   In Explore, the chart title used its own permission rule: the user had to be 
in the chart's explicit `editors` list or hold the store's `can_overwrite` 
grant. The chart's other edit actions use the shared `canOverwriteSlice` 
predicate: overwrite in the save modal, edit properties and version history. 
That predicate also allows administrators and editors granted through 
`extra_editors` (a deployment's `EXTRA_EDITORS_RESOLVER`). As a result, an 
admin or extra editor could save over a chart but could not rename it in the 
header. This affects every seeded or example chart, which has no explicit 
editors.
   
   The title now calls `canOverwriteSlice` too, so one rule governs all of the 
chart's edit actions. Two title-specific conditions are kept:
   - New, unsaved charts stay editable.
   - The title stays read-only while a version preview is active.
   
   The optional `extra_editors` field, which the API already returns, is added 
to the `Slice` type, and the Explore docs mention who can edit a chart's title.
   
   Behavior by user:
   
   | User | Before | After |
   | --- | --- | --- |
   | Admin, not an explicit editor | Title read-only | Title editable |
   | Extra editor (via `EXTRA_EDITORS_RESOLVER`) | Title read-only | Title 
editable |
   | Explicit editor, or user with the overwrite grant | Editable | Editable |
   | Unrelated viewer | Read-only | Read-only |
   | Any user on an externally managed chart | Editable with the overwrite 
grant | Read-only, matching the save modal and properties modal |
   | Any user during a version preview | Read-only | Read-only |
   | New, unsaved chart | Editable | Editable |
   
   The only narrowing is the externally managed chart. Its title was the one 
place such a chart could still be edited, and the change there could not be 
saved over the chart anyway.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   Not captured: this is a permission-gate fix with no visual change. The table 
above describes the behavior before and after.
   
   ### TESTING INSTRUCTIONS
   
   Automated:
   
   ```bash
   cd superset-frontend && npm run test -- 
src/explore/components/ExploreChartHeader/ExploreChartHeader.test.tsx
   ```
   
   The new cases cover each route to permission and each exclusion: admin, 
extra editor, owner subject, overwrite grant, unrelated viewer, externally 
managed chart, version preview and new chart. With the previous component, the 
admin, extra-editor and managed-chart cases fail. Changed-file pre-commit 
passed, including frontend type checking.
   
   Manual:
   
   1. As an admin, open an example chart with no explicit editors in Explore. 
The title is editable, and the rename saves through **Save → Overwrite**.
   2. As a Gamma user who neither edits nor owns the chart, open it. The title 
is read-only.
   3. On an externally managed chart, the title is read-only for everyone.
   
   ### 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
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   
   @aminghadersohi @rebenitez1802
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


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