mirror of
https://github.com/apache/superset.git
synced 2026-04-21 09:04:38 +00:00
feat: apply RLS conservatively (#38683)
This commit is contained in:
@@ -260,12 +260,13 @@ class RLSAsSubqueryTransformer(RLSTransformer):
|
||||
if node.alias:
|
||||
alias = node.alias
|
||||
else:
|
||||
name = ".".join(
|
||||
part
|
||||
for part in (node.catalog or "", node.db or "", node.name)
|
||||
if part
|
||||
)
|
||||
alias = exp.TableAlias(this=exp.Identifier(this=name, quoted=True))
|
||||
# Use just the table name (not schema-qualified) so that
|
||||
# column references like ``table.column`` still resolve after
|
||||
# the table is replaced with a subquery. Using the full
|
||||
# ``schema.table`` path as a quoted identifier creates a
|
||||
# mismatch: the columns reference ``table`` but the alias is
|
||||
# ``"schema.table"``, which are different identifiers.
|
||||
alias = exp.TableAlias(this=exp.Identifier(this=node.name, quoted=True))
|
||||
|
||||
node.set("alias", None)
|
||||
node = exp.Subquery(
|
||||
|
||||
Reference in New Issue
Block a user