You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "mikebridge (via GitHub)" <gi...@apache.org> on 2026/09/11 21:35:47 UTC
[PR] fix(archive): hide recovery actions from read-only users [superset]
mikebridge opened a new pull request, #44179:
URL: https://github.com/apache/superset/pull/44179
### SUMMARY
Fixes the Recently Archived view offering Recover and Delete permanently actions to read-only users. The shared list now uses the selected resource's existing `can_write` permission from `_info`, matching the restore/purge API permission mappings for dashboards, charts, and datasets.
Readable archived rows remain visible, but the Actions column and recovery tooltip are hidden without write permission. Existing server-side authorization and ownership checks are unchanged. Permissions remain fail-closed while loading or after an info request failure, and reset when switching object types.
Associated ticket: [SC-120335](https://app.shortcut.com/preset/story/120335).
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before: a read-only user could see a Recover control on a readable archived dashboard; clicking it resulted in a server-denied request.
After: read-only users see the archived rows without recovery/deletion controls or recovery guidance. Write-enabled users retain the existing controls.
No screenshots captured locally; browser verification remains outstanding because the local application health endpoint returns HTTP 500.
### TESTING INSTRUCTIONS
Automated verification:
```bash
cd superset-frontend
npm run test -- --maxWorkers=2 src/pages/ArchivedList/ArchivedList.test.tsx
```
39 tests pass, including 10 added cases covering read-only/write-enabled access across all three types, delete-only permissions, permission loading/failure, and type switching. All applicable staged pre-commit hooks pass, including TypeScript.
Manual verification (outstanding):
1. Enable `SOFT_DELETE` and archive a dashboard readable by a user with Dashboard read/export permissions but no write permission.
2. As that user, open Recently Archived and select Dashboard. Confirm readable rows remain visible but no Actions column, Recover/Delete permanently buttons, or recovery tooltip appears.
3. Repeat for Chart and Dataset with readable archived objects and read-only permissions.
4. As a write-enabled editor or admin, confirm Recover remains available and restores an eligible object successfully.
5. Switch between types for which the user has different write permissions and confirm controls follow the selected type.
### ADDITIONAL INFORMATION
- [x] Has associated issue: [SC-120335](https://app.shortcut.com/preset/story/120335)
- [x] Required feature flags: `SOFT_DELETE`
- [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
No schema, API, dependency, or permission-definition changes.
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(archive): hide recovery actions from read-only users [superset]
Posted by "aminghadersohi (via GitHub)" <gi...@apache.org>.
aminghadersohi commented on code in PR #44179:
URL: https://github.com/apache/superset/pull/44179#discussion_r4002391485
##########
docs/docs/using-superset/recently-archived.mdx:
##########
@@ -54,6 +54,11 @@ returns to its normal list and disappears from the archive. Recovering is
limited to the object's editors and admins; you can only recover objects you
are able to see in this view.
+Seeing an archived object and acting on it are separate permissions: objects
+you can view but not edit still appear in the list, but their rows carry no
+actions. The **Recover** and **Delete permanently** buttons are shown only
+for objects you have permission to edit.
Review Comment:
The gate is `hidden: !canWrite` โ a class-level `can_write` from `_info` applied to the whole Actions column, so it's all-or-nothing per object *type*, not per object. Someone with write on Dashboard still sees **Recover** on archived dashboards they can't recover.
```suggestion
actions. The **Recover** and **Delete permanently** buttons appear only if you
have edit permission for that object type; recovering a specific object can
still be refused if you are not one of its editors.
```
##########
docs/docs/using-superset/recently-archived.mdx:
##########
@@ -62,7 +67,8 @@ You will be asked to confirm.
This cannot be undone. Unlike archiving, it does not move the object anywhere
โ the object and its version history are erased, and no retention window
applies. The same audience that can recover an object can delete it
-permanently: its editors and admins.
+permanently: its editors and admins. As with recovery, the action appears
+only on rows you have permission to edit.
Review Comment:
Same per-type vs per-object overstatement as above.
```suggestion
permanently: its editors and admins. As with recovery, the action appears only
if you have edit permission for that object type; a specific object can still
be refused.
```
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(archive): hide recovery actions from read-only users [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #44179:
URL: https://github.com/apache/superset/pull/44179#issuecomment-5642998957
AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
<details>
<summary>
Bito Usage Guide
</summary>
**Commands**
Type the following command in the pull request comment and save the comment.
- `/review` - Manually triggers an incremental AI Review.
- `/review full` - Manually triggers a full AI Review.
- `/pause` - Pauses automatic reviews on this pull request.
- `/resume` - Resumes automatic reviews.
- `/resolve` - Marks all Bito-posted review comments as resolved.
- `/abort` - Cancels all in-progress reviews.
Refer to the <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/available-commands" target="_blank" rel="noopener noreferrer">documentation</a> for additional commands.
**Configuration**
This repository uses `Superset` You can customize the agent settings <a href="https://alpha.bito.ai/home/ai-agents/code-review-agent" target="_blank" rel="noopener noreferrer">here</a> or contact your Bito workspace admin at evan@preset.io.
**Documentation & Help**
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/getting-started/install-run-using-bito-cloud/create-or-customize-an-agent-instance" target="_blank" rel="noopener noreferrer">Customize agent settings</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/implementing-custom-code-review-rules" target="_blank" rel="noopener noreferrer">Review rules</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent" target="_blank" rel="noopener noreferrer">General documentation</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/faqs" target="_blank" rel="noopener noreferrer">FAQ</a>
</details>
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(archive): hide recovery actions from read-only users [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #44179:
URL: https://github.com/apache/superset/pull/44179#issuecomment-5640910793
AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(archive): hide recovery actions from read-only users [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #44179:
URL: https://github.com/apache/superset/pull/44179#issuecomment-5669235103
AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
<details>
<summary>
Bito Usage Guide
</summary>
**Commands**
Type the following command in the pull request comment and save the comment.
- `/review` - Manually triggers an incremental AI Review.
- `/review full` - Manually triggers a full AI Review.
- `/pause` - Pauses automatic reviews on this pull request.
- `/resume` - Resumes automatic reviews.
- `/resolve` - Marks all Bito-posted review comments as resolved.
- `/abort` - Cancels all in-progress reviews.
Refer to the <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/available-commands" target="_blank" rel="noopener noreferrer">documentation</a> for additional commands.
**Configuration**
This repository uses `Superset` You can customize the agent settings <a href="https://alpha.bito.ai/home/ai-agents/code-review-agent" target="_blank" rel="noopener noreferrer">here</a> or contact your Bito workspace admin at evan@preset.io.
**Documentation & Help**
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/getting-started/install-run-using-bito-cloud/create-or-customize-an-agent-instance" target="_blank" rel="noopener noreferrer">Customize agent settings</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/implementing-custom-code-review-rules" target="_blank" rel="noopener noreferrer">Review rules</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent" target="_blank" rel="noopener noreferrer">General documentation</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/faqs" target="_blank" rel="noopener noreferrer">FAQ</a>
</details>
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(archive): hide recovery actions from read-only users [superset]
Posted by "netlify[bot] (via GitHub)" <gi...@apache.org>.
netlify[bot] commented on PR #44179:
URL: https://github.com/apache/superset/pull/44179#issuecomment-5640925463
### <span aria-hidden="true">โ
</span> Deploy Preview for *superset-docs-preview* ready!
| Name | Link |
|:-:|------------------------|
|<span aria-hidden="true">๐จ</span> Latest commit | 2aa27e1a00971cd3a892b61800849aced8abbb81 |
|<span aria-hidden="true">๐</span> Latest deploy log | https://app.netlify.com/projects/superset-docs-preview/deploys/6aa474333ca1f70009d8731e |
|<span aria-hidden="true">๐</span> Deploy Preview | [https://deploy-preview-44179--superset-docs-preview.netlify.app](https://deploy-preview-44179--superset-docs-preview.netlify.app) |
|<span aria-hidden="true">๐ฑ</span> Preview on mobile | <details><summary> Toggle QR Code... </summary><br /><br /><br /><br />_Use your smartphone camera to open QR code link._</details> |
|<span aria-hidden="true">๐ค</span> Make changes | [Run an agent on this branch](https://app.netlify.com/projects/superset-docs-preview/agent-runs#DctRCsIwDADQu-TbQGs2q97AY2RJpAW3llQGQ7z7-vd-3g-a17V94QlwgcV5kzzcBeM1EM3ILrnspqjc81LZFd2k7ubYzNfSe6nbqGrtU4-XjnxjntJERMLxnUIID70nigb_Ew) |
---
<!-- [superset-docs-preview Preview](https://deploy-preview-44179--superset-docs-preview.netlify.app) -->
_To edit notification comments on pull requests, go to your [Netlify project configuration](https://app.netlify.com/projects/superset-docs-preview/configuration/notifications#deploy-notifications)._
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(archive): hide recovery actions from read-only users [superset]
Posted by "mikebridge (via GitHub)" <gi...@apache.org>.
mikebridge commented on code in PR #44179:
URL: https://github.com/apache/superset/pull/44179#discussion_r4008385967
##########
docs/docs/using-superset/recently-archived.mdx:
##########
@@ -54,6 +54,12 @@ returns to its normal list and disappears from the archive. Recovering is
limited to the object's editors and admins; you can only recover objects you
are able to see in this view.
+Seeing an archived object and acting on it are separate permissions: objects
+you can view but not edit still appear in the list, but their rows carry no
+actions. The **Recover** and **Delete permanently** buttons appear only if you
+have edit permission for that object type; recovering a specific object can
+still be refused if you are not one of its editors.
Review Comment:
addressed in 310f8cf585
*Posted by Claude (AI) on behalf of @mikebridge.*
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(archive): hide recovery actions from read-only users [superset]
Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on code in PR #44179:
URL: https://github.com/apache/superset/pull/44179#discussion_r3995236035
##########
superset-frontend/src/pages/ArchivedList/index.tsx:
##########
@@ -187,11 +188,13 @@ function ArchivedListBody({
[],
baseFilters,
);
+ // Restore and purge both require the selected resource's write permission.
+ const canWrite = hasPerm('can_write');
Review Comment:
**Suggestion:** Users with resource-level `can_write` but no editorship still see actions for every archived row, then receive 403 responses from the editorship checks. [api mismatch]
**Assessment:** ๐ `Major` ยท ๐ `Occurrence: Sometimes`
[](https://docs.codeant.ai/cli/resolve-pr-comments-skill) [](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=5e637fb28433499aa2e8d114a1ba7c72&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset) [](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=5e637fb28433499aa2e8d114a1ba7c72&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
<details>
<summary><b>Prompt for AI Agent ๐ค </b></summary>
```mdx
This is a comment left during a code review.
**Path:** superset-frontend/src/pages/ArchivedList/index.tsx
**Line:** 192:192
**Comment:**
*Api Mismatch: Users with resource-level `can_write` but no editorship still see actions for every archived row, then receive 403 responses from the editorship checks.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
```
</details>
<a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F44179&comment_hash=1286324ecdbd33964fbb1344693f303725797629c5a2e4a7639e045c3d44c516&reaction=like'>๐</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F44179&comment_hash=1286324ecdbd33964fbb1344693f303725797629c5a2e4a7639e045c3d44c516&reaction=dislike'>๐</a>
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(archive): hide recovery actions from read-only users [superset]
Posted by "aminghadersohi (via GitHub)" <gi...@apache.org>.
aminghadersohi commented on code in PR #44179:
URL: https://github.com/apache/superset/pull/44179#discussion_r4007586811
##########
docs/docs/using-superset/recently-archived.mdx:
##########
@@ -54,6 +54,12 @@ returns to its normal list and disappears from the archive. Recovering is
limited to the object's editors and admins; you can only recover objects you
are able to see in this view.
+Seeing an archived object and acting on it are separate permissions: objects
+you can view but not edit still appear in the list, but their rows carry no
+actions. The **Recover** and **Delete permanently** buttons appear only if you
+have edit permission for that object type; recovering a specific object can
+still be refused if you are not one of its editors.
Review Comment:
My round-2 span started one sentence too late: "their rows carry no actions" makes the same per-object claim I flagged next door. Under the class-level gate, an object you can view but not edit does show actions if you have write on its type.
```suggestion
Seeing an archived object and acting on it are separate permissions: objects
you can view but not edit still appear in the list. The **Recover** and
**Delete permanently** buttons appear only if you have edit permission for
that object type; recovering a specific object can still be refused if you
are not one of its editors.
```
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(archive): hide recovery actions from read-only users [superset]
Posted by "richardfogaca (via GitHub)" <gi...@apache.org>.
richardfogaca merged PR #44179:
URL: https://github.com/apache/superset/pull/44179
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(archive): hide recovery actions from read-only users [superset]
Posted by "mikebridge (via GitHub)" <gi...@apache.org>.
mikebridge commented on code in PR #44179:
URL: https://github.com/apache/superset/pull/44179#discussion_r3995223828
##########
superset-frontend/src/pages/ArchivedList/ArchivedList.test.tsx:
##########
@@ -227,6 +238,106 @@ test('issues the deleted-only baseline filter on the list request', async () =>
});
});
+test.each([
+ { resource: 'chart', label: 'Chart', name: 'Deleted Chart One' },
+ { resource: 'dashboard', label: 'Dashboard', name: 'Deleted Dashboard One' },
+ { resource: 'dataset', label: 'Dataset', name: 'deleted_table_one' },
+])(
+ 'read-only $label rows do not offer recovery or purge',
+ async ({ resource, label, name }) => {
+ mockRoutes(200, {}, buildPositiveImpact(), {
+ [resource]: { permissions: ['can_read', 'can_export'] },
+ });
+ renderArchivedList(storeWithReadAccess(label));
+
+ const rowName = await screen.findByText(name);
+ expect(
+ screen.queryByRole('columnheader', { name: 'Actions' }),
+ ).not.toBeInTheDocument();
+ expect(screen.queryAllByTestId('archived-row-restore')).toHaveLength(0);
+ expect(screen.queryAllByTestId('archived-row-purge')).toHaveLength(0);
+ userEvent.hover(rowName);
Review Comment:
Fixed in `f20d56e24c`: the hover is awaited and the test now anchors on the new read-only tooltip copy appearing (findBy waits out the mouseEnterDelay) before asserting the editor copy is absent โ so the absence assertion can no longer pass vacuously. The write-permission test gained the positive control you suggested: an editor's hover surfaces the recover prompt.
*Posted by Claude (AI) on behalf of @mikebridge.*
##########
superset-frontend/src/pages/ArchivedList/index.tsx:
##########
@@ -432,10 +435,12 @@ function ArchivedListBody({
// rather than told anything. Neither is a preview, and the silent
// one is the worse of the two, so no row links out until the object
// is recovered.
- return (
+ return canWrite ? (
Review Comment:
Agreed and done in `f20d56e24c` with your copy verbatim: read-only rows now get their own tooltip โ "Archived items must be recovered before they can be opened." โ so both audiences learn why the name isn't a link (editors get the recover prompt, readers the precondition).
*Posted by Claude (AI) on behalf of @mikebridge.*
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(archive): hide recovery actions from read-only users [superset]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #44179:
URL: https://github.com/apache/superset/pull/44179#issuecomment-5641024178
## [Codecov](https://app.codecov.io/gh/apache/superset/pull/44179?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 80.16%. Comparing base ([`36361d9`](https://app.codecov.io/gh/apache/superset/commit/36361d9d0462b34114d4be0a87ca78d7a576f387?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`2aa27e1`](https://app.codecov.io/gh/apache/superset/commit/2aa27e1a00971cd3a892b61800849aced8abbb81?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 4 commits behind head on master.
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #44179 +/- ##
===========================================
+ Coverage 66.18% 80.16% +13.98%
===========================================
Files 2925 2925
Lines 172563 172566 +3
Branches 40058 40060 +2
===========================================
+ Hits 114212 138343 +24131
+ Misses 55970 31626 -24344
- Partials 2381 2597 +216
```
| [Flag](https://app.codecov.io/gh/apache/superset/pull/44179/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage ฮ | |
|---|---|---|
| [javascript](https://app.codecov.io/gh/apache/superset/pull/44179/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `75.66% <100.00%> (+<0.01%)` | :arrow_up: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
</details>
[:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/superset/pull/44179?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(archive): hide recovery actions from read-only users [superset]
Posted by "mikebridge (via GitHub)" <gi...@apache.org>.
mikebridge commented on code in PR #44179:
URL: https://github.com/apache/superset/pull/44179#discussion_r4007099357
##########
docs/docs/using-superset/recently-archived.mdx:
##########
@@ -54,6 +54,11 @@ returns to its normal list and disappears from the archive. Recovering is
limited to the object's editors and admins; you can only recover objects you
are able to see in this view.
+Seeing an archived object and acting on it are separate permissions: objects
+you can view but not edit still appear in the list, but their rows carry no
+actions. The **Recover** and **Delete permanently** buttons are shown only
+for objects you have permission to edit.
Review Comment:
Applied verbatim in `833b8cb2f6` โ thanks, the per-type/per-object split is exactly right: the column gate is the class-level `can_write`, and the object-level editorship check stays server-side.
*Posted by Claude (AI) on behalf of @mikebridge.*
##########
docs/docs/using-superset/recently-archived.mdx:
##########
@@ -62,7 +67,8 @@ You will be asked to confirm.
This cannot be undone. Unlike archiving, it does not move the object anywhere
โ the object and its version history are erased, and no retention window
applies. The same audience that can recover an object can delete it
-permanently: its editors and admins.
+permanently: its editors and admins. As with recovery, the action appears
+only on rows you have permission to edit.
Review Comment:
Applied verbatim in `833b8cb2f6`, matching the recovery wording above.
*Posted by Claude (AI) on behalf of @mikebridge.*
##########
superset-frontend/src/pages/ArchivedList/index.tsx:
##########
@@ -187,11 +188,13 @@ function ArchivedListBody({
[],
baseFilters,
);
+ // Restore and purge both require the selected resource's write permission.
+ const canWrite = hasPerm('can_write');
Review Comment:
Accurate observation โ the Actions column is gated by the class-level `can_write`, so a write-capable non-editor can see **Recover** on a specific object and be refused by the server-side editorship check. Making the affordance per-object would need editor/owner data the archived list endpoints do not return, so this PR keeps the class-level gate (matching the other list views) with the server remaining authoritative. Resolved by documenting the split instead, using the human reviewer's wording in `833b8cb2f6`: the buttons appear per object *type*; a specific object can still be refused.
*Posted by Claude (AI) on behalf of @mikebridge.*
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(archive): hide recovery actions from read-only users [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #44179:
URL: https://github.com/apache/superset/pull/44179#issuecomment-5644673904
AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
<details>
<summary>
Bito Usage Guide
</summary>
**Commands**
Type the following command in the pull request comment and save the comment.
- `/review` - Manually triggers an incremental AI Review.
- `/review full` - Manually triggers a full AI Review.
- `/pause` - Pauses automatic reviews on this pull request.
- `/resume` - Resumes automatic reviews.
- `/resolve` - Marks all Bito-posted review comments as resolved.
- `/abort` - Cancels all in-progress reviews.
Refer to the <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/available-commands" target="_blank" rel="noopener noreferrer">documentation</a> for additional commands.
**Configuration**
This repository uses `Superset` You can customize the agent settings <a href="https://alpha.bito.ai/home/ai-agents/code-review-agent" target="_blank" rel="noopener noreferrer">here</a> or contact your Bito workspace admin at evan@preset.io.
**Documentation & Help**
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/getting-started/install-run-using-bito-cloud/create-or-customize-an-agent-instance" target="_blank" rel="noopener noreferrer">Customize agent settings</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/implementing-custom-code-review-rules" target="_blank" rel="noopener noreferrer">Review rules</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent" target="_blank" rel="noopener noreferrer">General documentation</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/faqs" target="_blank" rel="noopener noreferrer">FAQ</a>
</details>
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(archive): hide recovery actions from read-only users [superset]
Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on code in PR #44179:
URL: https://github.com/apache/superset/pull/44179#discussion_r4007104400
##########
superset-frontend/src/pages/ArchivedList/index.tsx:
##########
@@ -187,11 +188,13 @@ function ArchivedListBody({
[],
baseFilters,
);
+ // Restore and purge both require the selected resource's write permission.
+ const canWrite = hasPerm('can_write');
Review Comment:
โ
**Customized review instruction saved!**
**Instruction:**
> Do not require per-object action gating when archived list endpoints do not provide editor/owner data; retain the class-level write-permission gate and rely on server-side editorship checks.
**Applied to:**
- `superset-frontend/src/pages/ArchivedList/index.tsx`
---
๐ก *To manage or update this instruction, visit: [CodeAnt AI Settings](https://app.codeant.ai/org/settings/learnings)*
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(archive): hide recovery actions from read-only users [superset]
Posted by "aminghadersohi (via GitHub)" <gi...@apache.org>.
aminghadersohi commented on code in PR #44179:
URL: https://github.com/apache/superset/pull/44179#discussion_r3993671100
##########
superset-frontend/src/pages/ArchivedList/ArchivedList.test.tsx:
##########
@@ -227,6 +238,106 @@ test('issues the deleted-only baseline filter on the list request', async () =>
});
});
+test.each([
+ { resource: 'chart', label: 'Chart', name: 'Deleted Chart One' },
+ { resource: 'dashboard', label: 'Dashboard', name: 'Deleted Dashboard One' },
+ { resource: 'dataset', label: 'Dataset', name: 'deleted_table_one' },
+])(
+ 'read-only $label rows do not offer recovery or purge',
+ async ({ resource, label, name }) => {
+ mockRoutes(200, {}, buildPositiveImpact(), {
+ [resource]: { permissions: ['can_read', 'can_export'] },
+ });
+ renderArchivedList(storeWithReadAccess(label));
+
+ const rowName = await screen.findByText(name);
+ expect(
+ screen.queryByRole('columnheader', { name: 'Actions' }),
+ ).not.toBeInTheDocument();
+ expect(screen.queryAllByTestId('archived-row-restore')).toHaveLength(0);
+ expect(screen.queryAllByTestId('archived-row-purge')).toHaveLength(0);
+ userEvent.hover(rowName);
Review Comment:
`userEvent.hover` (v12) is synchronous and antd Tooltip has a 0.1s `mouseEnterDelay`, so this assertion passes even if the tooltip would render โ it passes on master too. Nothing else asserts the tooltip ever appears, so the suppression isn't actually pinned.
##########
superset-frontend/src/pages/ArchivedList/index.tsx:
##########
@@ -432,10 +435,12 @@ function ArchivedListBody({
// rather than told anything. Neither is a preview, and the silent
// one is the worse of the two, so no row links out until the object
// is recovered.
- return (
+ return canWrite ? (
Review Comment:
Dropping the tooltip for read-only users also drops the only explanation for why the name isn't a link โ they get a bare, unexplained non-clickable name. A read-only variant (e.g. "Archived items must be recovered before they can be opened") may serve them better than none.
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org