rusackas opened a new pull request, #42936:
URL: https://github.com/apache/superset/pull/42936

   ### SUMMARY
   
   Two unrelated but similarly-shaped fixes: each adds a missing check that a 
sibling code path in the same class already performs.
   
   - Both the legacy `Datasource.save` view and `UpdateDatasetCommand` let an 
editor change a dataset's `database_id` to any value while only checking 
ownership of the dataset itself, not access to the target database connection. 
Editorship of a dataset doesn't imply access to every database connection in 
the deployment. Both now route the `database_id` change through 
`security_manager.raise_for_access` with the resolved `Database` object before 
persisting it, mirroring the check `CreateDatasetCommand` already performs when 
attaching a new dataset to a database. Access denial leaves `database_id` 
unchanged.
   - `TabStateView.delete_query` updated the tab's `latest_query_id` pointer 
without first checking that the caller owns the tab, unlike every other 
mutating method on `TabStateView`/`TableSchemaView`. Added the same ownership 
guard used by `put`/`activate`/`migrate_query`/etc.
   
   ### TESTING INSTRUCTIONS
   
   ```bash
   pytest tests/unit_tests/views/test_sql_lab_tab_state_views.py
   pytest tests/unit_tests/views/datasource/views_test.py
   pytest tests/unit_tests/commands/dataset/update_test.py
   ```
   
   ### ADDITIONAL INFORMATION
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API


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