amitNielsen commented on a change in pull request #10594:
URL: 
https://github.com/apache/incubator-superset/pull/10594#discussion_r489610630



##########
File path: superset/security/manager.py
##########
@@ -967,26 +947,20 @@ def __find_permission_view_menu_by_instances(  # pylint: 
disable=C0103
             )
         return None
 
-    def update_dashboard_permission(self, dashboard: Dashboard) -> None:
-        new_perm = dashboard.view_name
-        current_perm = self.find_view_menu_by_pattern(dashboard.id)
-        if not current_perm:
-            self.add_view_menu(new_perm)
-        elif new_perm != current_perm.name:
-            current_perm.name = new_perm
-            self.get_session().merge(current_perm)
-            self.get_session().commit()
+    def update_view_menu(self, view_menu: ViewMenu) -> None:
+        self.get_session.merge(view_menu)
+        self.get_session.commit()
 
-    def find_view_menu_by_pattern(self, dashboard_id: int) -> ViewMenu:
+    def find_view_menu_by_pattern(
+        self, pattern: str, is_regex: bool = False
+    ) -> List[ViewMenu]:
         """
             Finds and returns a ViewMenu by name
         """
-        results = self.get_session.query(self.viewmenu_model).filter(
-            ViewMenu.name.like(f"dashboard.%")
+        pattern_filter = (

Review comment:
       nice one




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



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

Reply via email to