GitHub user dosubot[bot] added a comment to the discussion: Seeking Some Help 
On DataSource Security / RLS

<!-- Answer -->
To address the issue where Superset matches the table using both the schema and 
table name, you can use the `get_rls_for_table` function. This function 
attempts to match the table using both the schema and table name. If the schema 
is not specified in the query, Superset uses the `get_default_schema_for_query` 
method to determine the default schema. This method considers the schema 
selected in SQL Lab, the SQLAlchemy URI, or uses the SQLAlchemy inspector if 
necessary. Ensure that the database's default schema is correctly configured to 
align with the intended query execution context. This way, even if the schema 
is not explicitly mentioned in the query, the function will use the determined 
default schema to find the correct table and apply the associated RLS 
predicates 
<sup>[[1]](https://github.com/apache/superset/blob/master/superset/sql_parse.py)</sup><sup>[[2]](https://github.com/apache/superset/blob/master/superset/security/manager.py)</sup>.


<!-- Dosu Comment Footer -->
*To continue talking to [Dosu](https://dosu.dev), mention @dosu.*

---
<sup>Help Dosu learn! Give it feedback: [Great 
Response](https://app.dosu.dev/response-feedback/6a3e3e3d-ad67-41c6-928b-517b66d4a116?feedback_type=great_response)
 | [Irrelevant 
Answer](https://app.dosu.dev/response-feedback/6a3e3e3d-ad67-41c6-928b-517b66d4a116?feedback_type=irrelevant_answer)
 | [Incorrect 
Sources](https://app.dosu.dev/response-feedback/6a3e3e3d-ad67-41c6-928b-517b66d4a116?feedback_type=incorrect_sources)
 | [Too 
Verbose](https://app.dosu.dev/response-feedback/6a3e3e3d-ad67-41c6-928b-517b66d4a116?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/6a3e3e3d-ad67-41c6-928b-517b66d4a116?feedback_type=hallucination)
 | [Bug 
Report](https://app.dosu.dev/response-feedback/6a3e3e3d-ad67-41c6-928b-517b66d4a116?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/6a3e3e3d-ad67-41c6-928b-517b66d4a116?feedback_type=other)</sup>


GitHub link: 
https://github.com/apache/superset/discussions/33308#discussioncomment-13008336

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: 
[email protected]


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

Reply via email to