dpgaspar commented on code in PR #28394: URL: https://github.com/apache/superset/pull/28394#discussion_r1595251559
########## superset/migrations/shared/catalogs.py: ########## @@ -57,17 +126,41 @@ def upgrade_schema_perms(engine: str | None = None) -> None: None, schema, ) - existing_pvm = security_manager.find_permission_view_menu( - "schema_access", - perm, - ) + existing_pvm = session.query(ViewMenu).filter_by(name=perm).one_or_none() if existing_pvm: - existing_pvm.view_menu.name = security_manager.get_schema_perm( + existing_pvm.name = security_manager.get_schema_perm( database.database_name, catalog, schema, ) + # update existing models + models = [ + (Query, "database_id"), + (SavedQuery, "db_id"), + (TabState, "database_id"), + (TableSchema, "database_id"), + (SqlaTable, "database_id"), + ] Review Comment: do we have tests for the `upgrade_schema_perms` and `downgrade_schema_perms`? -- 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: notifications-unsubscr...@superset.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org For additional commands, e-mail: notifications-h...@superset.apache.org