From b5f2121f251c90d9aa98d5babeaed81c9c060c98 Mon Sep 17 00:00:00 2001 From: Evan Rusackas Date: Tue, 24 Aug 2021 09:38:41 -0600 Subject: [PATCH] Revert "fix(explore): let admin overwrite slice (#16290)" (#16408) This reverts commit d13b081cfe3527ad8f02f6622cad450b72bb541d. --- .../src/explore/components/PropertiesModal/index.tsx | 2 +- superset/views/core.py | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/superset-frontend/src/explore/components/PropertiesModal/index.tsx b/superset-frontend/src/explore/components/PropertiesModal/index.tsx index ab1e075a45cbb..0c46f6ba792f1 100644 --- a/superset-frontend/src/explore/components/PropertiesModal/index.tsx +++ b/superset-frontend/src/explore/components/PropertiesModal/index.tsx @@ -175,7 +175,7 @@ export default function PropertiesModal({ buttonStyle="primary" // @ts-ignore onClick={onSubmit} - disabled={submitting || !name} + disabled={!owners || submitting || !name} cta > {t('Save')} diff --git a/superset/views/core.py b/superset/views/core.py index 836bee4916b5c..f7c0281aef42c 100755 --- a/superset/views/core.py +++ b/superset/views/core.py @@ -122,7 +122,6 @@ get_error_msg, get_user_roles, handle_api_exception, - is_user_admin, json_error_response, json_errors_response, json_success, @@ -788,9 +787,7 @@ def explore( # pylint: disable=too-many-locals # slc perms slice_add_perm = security_manager.can_access("can_write", "Chart") - slice_overwrite_perm = ( - is_owner(slc, g.user) or is_user_admin() if slc else False - ) + slice_overwrite_perm = is_owner(slc, g.user) if slc else False slice_download_perm = security_manager.can_access("can_csv", "Superset") form_data["datasource"] = str(datasource_id) + "__" + cast(str, datasource_type)