dpgaspar commented on a change in pull request #17589:
URL: https://github.com/apache/superset/pull/17589#discussion_r759077156



##########
File path: superset/security/manager.py
##########
@@ -1160,6 +1160,18 @@ def get_rls_ids(self, table: "BaseDatasource") -> 
List[int]:
         ids.sort()  # Combinations rather than permutations
         return ids
 
+    @staticmethod
+    def raise_for_user_activity_access(user_id: int) -> None:
+        id_ = int(g.user.get_id())

Review comment:
       this may fail, `g.user` is not always safe

##########
File path: superset/security/manager.py
##########
@@ -1160,6 +1160,18 @@ def get_rls_ids(self, table: "BaseDatasource") -> 
List[int]:
         ids.sort()  # Combinations rather than permutations
         return ids
 
+    @staticmethod
+    def raise_for_user_activity_access(user_id: int) -> None:
+        id_ = int(g.user.get_id())

Review comment:
       also, why not just `g.user.id` ?

##########
File path: superset/views/core.py
##########
@@ -1526,7 +1538,7 @@ def available_domains(self) -> FlaskResponse:  # pylint: 
disable=no-self-use
     def fave_dashboards_by_username(self, username: str) -> FlaskResponse:
         """This lets us use a user's username to pull favourite dashboards"""
         user = security_manager.find_user(username=username)
-        return self.fave_dashboards(user.get_id())
+        return self.fave_dashboards(int(user.get_id()))

Review comment:
       `user.id`?




-- 
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