You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "suicide11 (via GitHub)" <gi...@apache.org> on 2023/10/03 16:54:30 UTC
Re: [PR] refactor: Issue #25040; Refactored sync_role_definition function in order to reduce number of query. [superset]
suicide11 commented on code in PR #25340:
URL: https://github.com/apache/superset/pull/25340#discussion_r1344435992
##########
superset/security/manager.py:
##########
@@ -822,6 +806,19 @@ def sync_role_definitions(self) -> None:
self.get_session.commit()
self.clean_perms()
+ def _get_all_pvms(self) -> list[PermissionView]:
+ # Fetch all pvms
+ pvms = (
+ self.get_session.query(self.permissionview_model)
+ .options(
+ eagerload(self.permissionview_model.permission),
+ eagerload(self.permissionview_model.view_menu),
+ )
+ .all()
+ )
+ pvms = [p for p in pvms if p.permission and p.view_menu]
Review Comment:
Done, Thanks for the the reviews @giftig .
--
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-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org