This is an automated email from the ASF dual-hosted git repository.
villebro pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/master by this push:
new d13b081 fix(explore): let admin overwrite slice (#16290)
d13b081 is described below
commit d13b081cfe3527ad8f02f6622cad450b72bb541d
Author: Ville Brofeldt <[email protected]>
AuthorDate: Tue Aug 17 10:55:33 2021 +0300
fix(explore): let admin overwrite slice (#16290)
---
superset-frontend/src/explore/components/PropertiesModal/index.tsx | 2 +-
superset/views/core.py | 5 ++++-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/superset-frontend/src/explore/components/PropertiesModal/index.tsx
b/superset-frontend/src/explore/components/PropertiesModal/index.tsx
index 0c46f6b..ab1e075 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={!owners || submitting || !name}
+ disabled={submitting || !name}
cta
>
{t('Save')}
diff --git a/superset/views/core.py b/superset/views/core.py
index cc03e8e..5faef20 100755
--- a/superset/views/core.py
+++ b/superset/views/core.py
@@ -122,6 +122,7 @@ from superset.views.base import (
get_error_msg,
get_user_roles,
handle_api_exception,
+ is_user_admin,
json_error_response,
json_errors_response,
json_success,
@@ -787,7 +788,9 @@ class Superset(BaseSupersetView): # pylint:
disable=too-many-public-methods
# slc perms
slice_add_perm = security_manager.can_access("can_write", "Chart")
- slice_overwrite_perm = is_owner(slc, g.user) if slc else False
+ slice_overwrite_perm = (
+ is_owner(slc, g.user) or is_user_admin() if slc else False
+ )
slice_download_perm = security_manager.can_access("can_csv",
"Superset")
form_data["datasource"] = str(datasource_id) + "__" + cast(str,
datasource_type)