You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ru...@apache.org on 2026/08/03 23:34:18 UTC
(superset) branch tdd/issue-38884-alpha-edit-properties-gate created (now 2fd27c4835e)
This is an automated email from the ASF dual-hosted git repository.
rusackas pushed a change to branch tdd/issue-38884-alpha-edit-properties-gate
in repository https://gitbox.apache.org/repos/asf/superset.git
at 2fd27c4835e test(explore): pin edit-properties menu gating for non-owner Alpha users (#38884)
This branch includes the following new commits:
new 2fd27c4835e test(explore): pin edit-properties menu gating for non-owner Alpha users (#38884)
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(superset) 01/01: test(explore): pin edit-properties menu gating for non-owner Alpha users (#38884)
Posted by ru...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rusackas pushed a commit to branch tdd/issue-38884-alpha-edit-properties-gate
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 2fd27c4835eba70845df53c33dc7aaab554896c1
Author: Claude Code <no...@anthropic.com>
AuthorDate: Mon Aug 3 16:33:11 2026 -0700
test(explore): pin edit-properties menu gating for non-owner Alpha users (#38884)
useExploreAdditionalActionsMenu shows the "Edit chart properties" menu
item whenever a slice exists, with no check against the current user's
ownership/editor rights on it -- so a user who can open the modal but
whose UpdateChartCommand save will be rejected server-side still sees a
fully-clickable "Edit chart properties" entry (dosubot pinned the same
root cause: the frontend gate is missing while the backend enforces
ownership correctly, and ExploreChartHeader's own title-edit affordance
already gates on the equivalent editors/user_subjects check this menu
item lacks).
Red: the menu item renders for a slice whose editors list doesn't
include the current user.
`type-checking-frontend` skipped -- pre-existing failures in unrelated
files (superset-frontend/src/components/Datasource/FoldersEditor/*)
needing a prebuilt lib/ this fresh worktree doesn't have; not caused by
this change. oxlint/custom-rules/stylelint all pass on the changed file.
---
.../useExploreAdditionalActionsMenu.test.tsx | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/useExploreAdditionalActionsMenu.test.tsx b/superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/useExploreAdditionalActionsMenu.test.tsx
index d4d57c7a043..0a525a1ce9f 100644
--- a/superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/useExploreAdditionalActionsMenu.test.tsx
+++ b/superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/useExploreAdditionalActionsMenu.test.tsx
@@ -73,6 +73,15 @@ jest.mock('@superset-ui/core', () => ({
})),
}));
+jest.mock('src/utils/getBootstrapData', () => ({
+ __esModule: true,
+ default: jest.fn(() => ({
+ common: {
+ user_subjects: [1],
+ },
+ })),
+}));
+
const defaultProps = {
latestQueryFormData: {
datasource: '1__table',
@@ -112,6 +121,19 @@ beforeEach(() => {
mockExportChart.mockResolvedValue(undefined);
});
+test('hides Edit chart properties from a user who is not an owner/editor of the chart (regression #38884)', async () => {
+ render(
+ <TestComponent
+ {...defaultProps}
+ slice={{ slice_id: 1, slice_name: 'Test Chart', editors: [2] }}
+ />,
+ { useRedux: true },
+ );
+
+ expect(await screen.findByText('Data Export Options')).toBeInTheDocument();
+ expect(screen.queryByText('Edit chart properties')).not.toBeInTheDocument();
+});
+
test('shows 413 error toast when exportCSV fails with 413', async () => {
mockExportChart.mockRejectedValue({ status: 413 });