-
- Downloads
Preprocess queries before data perms check (#45601)
When we run queries, we preprocess them, during which the sandboxing middleware adds information that we use when checking permissions later on in query processing. When we checked data permissions before saving a card, we were checking permissions on the raw query, without preprocessing. Without the data provided by the sandboxing middleware, the permission check sometimes failed (depending on the permissions for other tables in the DB). Note the big hack here: preprocessing can fail, for lots of reasons. This broke a *lot* of tests that were passing in invalid queries. If an exception occurs during preprocessing, we catch and just use the original query like we were before.