RLS OR-predicates re-associate and leak rows without parentheses
@icybawss▲ 0 net votes
When Superset injects an RLS predicate into a user's WHERE, a disjunctive rule (region='us' OR region='eu') can re-associate with the user's AND clause, giving region='us' OR (region='eu' AND user_filter). The query still runs and returns rows the rule should exclude. Wrap the RLS predicate in exp.Paren in the sqlglot transformer, and call .self_group() on OR-grouped filters before they are compiled individually.