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/06/14 09:33:07 UTC
(superset) branch fix-admin-save-chart created (now 186825dba62)
This is an automated email from the ASF dual-hosted git repository.
rusackas pushed a change to branch fix-admin-save-chart
in repository https://gitbox.apache.org/repos/asf/superset.git
at 186825dba62 Allow Admin non-owner to save chart
This branch includes the following new commits:
new 186825dba62 Allow Admin non-owner to save chart
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: Allow Admin non-owner to save chart
Posted by ru...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rusackas pushed a commit to branch fix-admin-save-chart
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 186825dba62227f238921fdc5e55603311a3b03f
Author: Pat Buxton <pa...@tartansolutions.com>
AuthorDate: Thu Jan 15 17:21:52 2026 +0000
Allow Admin non-owner to save chart
---
.../src/explore/components/SaveModal.test.tsx | 16 ++++++++++++++++
superset-frontend/src/explore/components/SaveModal.tsx | 8 ++++++--
2 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/superset-frontend/src/explore/components/SaveModal.test.tsx b/superset-frontend/src/explore/components/SaveModal.test.tsx
index 9a3ba617ec0..ae01446affb 100644
--- a/superset-frontend/src/explore/components/SaveModal.test.tsx
+++ b/superset-frontend/src/explore/components/SaveModal.test.tsx
@@ -319,6 +319,22 @@ test('disables overwrite option for externally managed slice', () => {
).toBeInTheDocument();
});
+test('enables overwrite option for admin non-owner', () => {
+ const { getByRole } = setup(
+ {},
+ mockStore({
+ ...initialState,
+ user: {
+ userId: 2,
+ username: 'Admin2',
+ roles: { Admin: Array(173) },
+ permissions: {},
+ },
+ }),
+ );
+ expect(getByRole('radio', { name: 'Save (Overwrite)' })).toBeEnabled();
+});
+
test('updates slice name and selected dashboard', async () => {
const dashboardId = mockEvent.value;
const saveDataset = jest.fn().mockResolvedValue(undefined);
diff --git a/superset-frontend/src/explore/components/SaveModal.tsx b/superset-frontend/src/explore/components/SaveModal.tsx
index ec169671271..7993308655f 100755
--- a/superset-frontend/src/explore/components/SaveModal.tsx
+++ b/superset-frontend/src/explore/components/SaveModal.tsx
@@ -49,7 +49,10 @@ import {
} from '@apache-superset/core/theme';
import { Radio } from '@superset-ui/core/components/Radio';
import { GRID_COLUMN_COUNT } from 'src/dashboard/util/constants';
-import { canUserEditDashboard } from 'src/dashboard/util/permissionUtils';
+import {
+ canUserEditDashboard,
+ isUserAdmin,
+} from 'src/dashboard/util/permissionUtils';
import { setSaveChartModalVisibility } from 'src/explore/actions/saveModalActions';
import { SaveActionType, ChartStatusType } from 'src/explore/types';
import { UserWithPermissionsAndRoles } from 'src/types/bootstrapTypes';
@@ -125,7 +128,8 @@ class SaveModal extends Component<SaveModalProps, SaveModalState> {
canOverwriteSlice(): boolean {
return (
- this.props.slice?.owners?.includes(this.props.user.userId) &&
+ (isUserAdmin(this.props.user) ||
+ this.props.slice?.owners?.includes(this.props.user.userId)) &&
!this.props.slice?.is_managed_externally
);
}