yousoph commented on code in PR #42404:
URL: https://github.com/apache/superset/pull/42404#discussion_r3833036041


##########
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:
   Fixed in b02bddbb — the new-theme import path now adds the importer as an 
editor (via `get_user_subject`), matching `CreateThemeCommand` and the 
dashboard/chart/dataset importers (which do the same `get_user_subject` + 
append to `.editors`). So a non-admin who imports a new theme can maintain it. 
Extended `test_import_theme` to assert the importer is among the theme's 
editors.



-- 
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]

Reply via email to