eschutho commented on code in PR #20149:
URL: https://github.com/apache/superset/pull/20149#discussion_r879697874


##########
superset/security/manager.py:
##########
@@ -668,13 +676,16 @@ def create_missing_perms(self) -> None:
             if pv.permission and pv.view_menu:
                 all_pvs.add((pv.permission.name, pv.view_menu.name))
 
-        def merge_pv(view_menu: str, perm: str) -> None:
+        def merge_pv(view_menu: str, perm: Optional[str]) -> None:
             """Create permission view menu only if it doesn't exist"""
             if view_menu and perm and (view_menu, perm) not in all_pvs:
                 self.add_permission_view_menu(view_menu, perm)
 
         logger.info("Creating missing datasource permissions.")
-        datasources = ConnectorRegistry.get_all_datasources(self.get_session)
+        # pylint: disable=import-outside-toplevel
+        from superset.datasource.dao import DatasourceDAO
+
+        datasources = 
DatasourceDAO.get_all_sqlatables_datasources(self.get_session)

Review Comment:
   I was noticing that SqlaTable has some class methods that access security 
manager, thus the circular dependencies. I think for the next PR we could just 
move all of this logic into the SqlaTable class, especially because there's 
only one model now that Native Druid is removed. 



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