betodealmeida commented on code in PR #33614:
URL: https://github.com/apache/superset/pull/33614#discussion_r2114015857


##########
docs/docs/configuration/sql-templating.mdx:
##########
@@ -250,6 +250,21 @@ Will be rendered as:
 SELECT * FROM users WHERE role IN ('admin', 'viewer')
 ```
 
+**Current User RLS Rules**
+
+The `{{ current_user_rls_rules() }}` macro returns an array of RLS rules 
applied to the current dataset for the logged in user.
+
+If you have caching enabled in your Superset configuration, then by default 
the list of RLS Rules will be used
+by Superset when calculating the cache key. A cache key is a unique identifier 
that determines if there's a
+cache hit in the future and Superset can retrieve cached data.
+
+You can disable the inclusion of the roles value in the calculation of the
+cache key by adding the following parameter to your Jinja code:
+
+```python
+{{ current_user_rls_rules(add_to_cache_keys=False) }}

Review Comment:
   > the macro returns RLS rules and cache would be isolated by the final SQL 
query, so different RLS configs should not overlap.
   
   But the cache is based on the pre-rendered query, no? At least that's what I 
understood from @john-bodley's [original 
PR](https://github.com/apache/superset/pull/9572).



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to