EnxDev commented on code in PR #45342:
URL: https://github.com/apache/superset/pull/45342#discussion_r4287512662


##########
superset/commands/dataset/update.py:
##########
@@ -283,6 +283,7 @@ def _validate_sql_access(
                     sql=sql,
                     catalog=catalog,
                     schema=schema,
+                    allow_dataset_editorship=False,

Review Comment:
   Correction to what I said above about the importer: the `datasource=dataset` 
check is not fine on overwrite. It accepts `is_editor(datasource)`, and 
overwrite (or restore of a soft-deleted row) only needs editorship of the row 
being replaced. So an editor could re-import their own `SELECT 1` decoy with 
`sql: null` and end up with a physical dataset over the real table, and the SQL 
check never runs because there's no SQL.
   
   Fixed in 2ef4edf721. When an import leaves a dataset physical and the 
dataset is new or bound to a different table, the importer also runs 
`raise_for_access(database=..., table=..., allow_dataset_editorship=False)`. 
Re-importing a physical dataset without changing its table keeps the existing 
checks, so owner export/import round trips aren't affected. Added tests for 
both cases.



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