jfrag1 commented on code in PR #25229:
URL: https://github.com/apache/superset/pull/25229#discussion_r1327810739


##########
superset/security/manager.py:
##########
@@ -2083,28 +2083,27 @@ def get_rls_filters(self, table: "BaseDatasource") -> 
list[SqlaQuery]:
         )
         return query.all()
 
-    def get_rls_ids(self, table: "BaseDatasource") -> list[int]:
+    def get_rls_filter_clauses(self, table: "BaseDatasource") -> list[str]:
         """
-        Retrieves the appropriate row level security filters IDs for the 
current user
+        Retrieves the appropriate row level security filters clauses for the 
current user
         and the passed table.
 
         :param table: The table to check against
-        :returns: A list of IDs
+        :returns: A list of clauses
         """
-        ids = [f.id for f in self.get_rls_filters(table)]
-        ids.sort()  # Combinations rather than permutations
-        return ids
+        clauses = [f.clause for f in self.get_rls_filters(table)]
+        clauses.sort()  # Combinations rather than permutations
+        return clauses

Review Comment:
   Clause is not nullable at the DB level, but I think that's still a good idea 
since there could in theory be an edge case where there are different RLS 
filters with the same clause but different id's/type (base vs regular).
   
   Updated to sort by id and concatenate the id with the clause



-- 
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: notifications-unsubscr...@superset.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org
For additional commands, e-mail: notifications-h...@superset.apache.org

Reply via email to