aneesh-joseph commented on a change in pull request #9973:
URL: https://github.com/apache/airflow/pull/9973#discussion_r629380571



##########
File path: airflow/www/security.py
##########
@@ -348,19 +348,21 @@ def can_read_dag(self, dag_id, user=None) -> bool:
         if not user:
             user = g.user
         dag_resource_name = permissions.resource_name_for_dag(dag_id)
-        return self._has_view_access(
-            user, permissions.ACTION_CAN_READ, permissions.RESOURCE_DAG
-        ) or self._has_view_access(user, permissions.ACTION_CAN_READ, 
dag_resource_name)
+        return bool(
+            self._has_view_access(user, permissions.ACTION_CAN_READ, 
permissions.RESOURCE_DAG)
+            or self._has_view_access(user, permissions.ACTION_CAN_READ, 
dag_resource_name)
+        )

Review comment:
       this is a problem as `_has_view_access` doesn't always return a bool, it 
returns a NoneType and then fails later on - 
https://github.com/apache/airflow/pull/9973#discussion_r614169639




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


Reply via email to