Skip to content

Commit

Permalink
fix(explore): let admin overwrite slice (apache#16290)
Browse files Browse the repository at this point in the history
  • Loading branch information
villebro authored Aug 17, 2021
1 parent 95e237a commit b6160a6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export default function PropertiesModal({
buttonStyle="primary"
// @ts-ignore
onClick={onSubmit}
disabled={!owners || submitting || !name}
disabled={submitting || !name}
cta
>
{t('Save')}
Expand Down
5 changes: 4 additions & 1 deletion superset/views/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@
get_error_msg,
get_user_roles,
handle_api_exception,
is_user_admin,
json_error_response,
json_errors_response,
json_success,
Expand Down Expand Up @@ -787,7 +788,9 @@ def explore( # pylint: disable=too-many-locals,too-many-return-statements,too-m

# 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)
Expand Down

0 comments on commit b6160a6

Please sign in to comment.