Skip to content

Commit

Permalink
Fix: Include RLS filters for cache keys (#10805)
Browse files Browse the repository at this point in the history
* Fix: Include RLS filters for cache keys

This fix makes sure that RLS filters are searched for templatable jinja content, ensuring cached visualizations aren't shown to the wrong user.

* Fix: Include RLS filters for cache keys

This fix makes sure that RLS filters are searched for templatable jinja content, ensuring cached visualizations aren't shown to the wrong user.

Co-authored-by: Ville Brofeldt <[email protected]>

Co-authored-by: Ville Brofeldt <[email protected]>
  • Loading branch information
gtg472b and villebro authored Sep 7, 2020
1 parent 92f2353 commit 702cfe9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions superset/connectors/sqla/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1454,6 +1454,10 @@ def has_extra_cache_key_calls(self, query_obj: QueryObjectDict) -> bool:
templatable_statements.append(extras["where"])
if "having" in extras:
templatable_statements.append(extras["having"])
if config["ENABLE_ROW_LEVEL_SECURITY"] and self.is_rls_supported:
templatable_statements += [
f.clause for f in security_manager.get_rls_filters(self)
]
for statement in templatable_statements:
if ExtraCache.regex.search(statement):
return True
Expand Down

0 comments on commit 702cfe9

Please sign in to comment.