You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/11/03 03:30:53 UTC

[GitHub] [airflow] jhtimmins commented on a change in pull request #19294: Simplify fab has access lookup

jhtimmins commented on a change in pull request #19294:
URL: https://github.com/apache/airflow/pull/19294#discussion_r741597558



##########
File path: airflow/www/fab_security/sqla/models.py
##########
@@ -178,6 +180,13 @@ def is_active(self):
     def is_anonymous(self):
         return False
 
+    @property
+    def perms(self):
+        perms = set()
+        for role in self.roles:
+            perms.update((perm.action.name, perm.resource.name) for perm in role.permissions)

Review comment:
       I added `lazy=joined` to several model fields, which causes prefetching. It now runs 11 queries instead of 49.




-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org