sadpandajoe commented on code in PR #42404:
URL: https://github.com/apache/superset/pull/42404#discussion_r3832614901
##########
superset/commands/theme/import_themes.py:
##########
@@ -39,11 +39,22 @@ def import_theme(config: dict[str, Any], overwrite: bool =
False) -> "Theme | No
from superset.utils.core import get_user
can_write = security_manager.can_access("can_write", "Theme")
+ user = get_user()
existing = db.session.query(Theme).filter_by(uuid=config["uuid"]).first()
if existing:
if not overwrite or not can_write:
return existing
+ # Overwriting an existing theme requires editorship (admins bypass).
Review Comment:
A non-admin who imports a new theme is never added to `theme.editors`: this
path sets only `created_by`/`changed_by`, while the new update/delete checks
now require editorship. That leaves the importer unable to maintain the theme
they just created. Should the new-theme import path populate the importer as an
editor, like `CreateThemeCommand` does?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]