jaketf commented on a change in pull request #18222: URL: https://github.com/apache/airflow/pull/18222#discussion_r708483857
########## File path: airflow/www/security.py ########## @@ -346,10 +346,7 @@ def get_current_user_permissions(self): return perms def current_user_has_permissions(self) -> bool: - for role in self.get_user_roles(): - if role.permissions: - return True - return False + return len(self.get_current_user_permissions()) > 0 Review comment: @uranusjr thanks for that feedback on blowing up DB queries. Would this be an acceptable workaround? Look for roles first (existing behavior), then look for permissions only if necessary? ```suggestion for role in self.get_user_roles(): if role.permissions: return True return len(self.get_current_user_permissions()) > 0 ``` -- 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-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org