altef commented on a change in pull request #8699: [SIP-29] Add support for 
row-level security
URL: 
https://github.com/apache/incubator-superset/pull/8699#discussion_r355293481
 
 

 ##########
 File path: superset/connectors/sqla/models.py
 ##########
 @@ -834,6 +843,10 @@ def get_sqla_query(  # sqla
                         where_clause_and.append(col_obj.get_sqla_col() == None)
                     elif op == "IS NOT NULL":
                         where_clause_and.append(col_obj.get_sqla_col() != None)
+
+        where_clause_and += [
+            text("({})".format(f)) for f in self._get_row_level_filters()
 
 Review comment:
   I tested this by adding an RLS filter that contained an `OR`.  It didn't end 
up getting wrapped in parentheses. So I still have the `"({})".filter(f)` in 
there, but I've moved it to the `_get_sqla_row_level_filters` method.
   It looks like similar was done in the `get_sql_query()` method, presumably 
for similar reason
   
https://github.com/apache/incubator-superset/blob/cae0583e0fbf8b60b9ee86179b4defef5da9b2c2/superset/connectors/sqla/models.py#L841

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to