dpgaspar commented on code in PR #25043:
URL: https://github.com/apache/superset/pull/25043#discussion_r1304546321
##########
superset/security/manager.py:
##########
@@ -1338,14 +1338,20 @@ def dataset_after_update(
:param target: The changed dataset object
:return:
"""
+ # pylint: disable=import-outside-toplevel
+ from superset.connectors.sqla.models import SqlaTable
+
# Check if watched fields have changed
- state = inspect(target)
- history_database = state.get_history("database_id", True)
- history_table_name = state.get_history("table_name", True)
- history_schema = state.get_history("schema", True)
+ table = SqlaTable.__table__
+ current_dataset = connection.execute(
+ table.select().where(table.c.id == target.id)
+ ).one()
+ current_db_id = current_dataset.database_id
+ current_schema = current_dataset.schema
+ current_table_name = current_dataset.table_name
# When database name changes
- if history_database.has_changes() and history_database.deleted:
+ if current_db_id != target.database_id:
Review Comment:
the dataset permission is a string that includes the `database_id`,
`table_name` and `schema` if those change we have to update the permission
string also
--
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]