giftig commented on code in PR #25340:
URL: https://github.com/apache/superset/pull/25340#discussion_r1330432468


##########
superset/security/manager.py:
##########
@@ -784,11 +786,17 @@ def sync_role_definitions(self) -> None:
 
         self.create_custom_permissions()
 
+        #Fetch all pvms
+        pvms = self.get_session.query(PermissionView).options(
+            eagerload(PermissionView.permission),
+            eagerload(PermissionView.view_menu)).all()
+        pvms = [p for p in pvms if p.permission and p.view_menu]

Review Comment:
   Does this check do anything? These are required relations, aren't they?



##########
superset/security/manager.py:
##########
@@ -864,7 +872,7 @@ def copy_role(
         self.get_session.commit()
 
     def set_role(
-        self, role_name: str, pvm_check: Callable[[PermissionView], bool]
+        self, role_name: str, pvm_check: Callable[[PermissionView], bool], 
pvms:[]

Review Comment:
   Type should be `list[PermissionView]` here?



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