diff --git a/superset/connectors/sqla/models.py b/superset/connectors/sqla/models.py index 601a69ddb63dd..667c9d4a3ee7b 100644 --- a/superset/connectors/sqla/models.py +++ b/superset/connectors/sqla/models.py @@ -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