phanikumv commented on code in PR #32883:
URL: https://github.com/apache/airflow/pull/32883#discussion_r1299931291


##########
airflow/www/security.py:
##########
@@ -358,16 +356,15 @@ def get_accessible_dag_ids(
             if (permissions.ACTION_CAN_EDIT in user_actions and 
self.can_edit_all_dags(user)) or (
                 permissions.ACTION_CAN_READ in user_actions and 
self.can_read_all_dags(user)
             ):
-                return {dag.dag_id for dag in session.query(DagModel.dag_id)}
-            user_query = (
-                session.query(User)
+                return {dag.dag_id for dag in 
session.execute(select(DagModel.dag_id))}
+            user_query = session.scalar(
+                select(User)
                 .options(
                     joinedload(User.roles)
                     .subqueryload(Role.permissions)
                     .options(joinedload(Permission.action), 
joinedload(Permission.resource))
                 )
-                .filter(User.id == user.id)
-                .first()
+                .where(User.id == user.id)

Review Comment:
   yeah, hence no change made



##########
airflow/www/security.py:
##########
@@ -524,10 +524,8 @@ def _merge_perm(self, action_name: str, resource_name: 
str) -> None:
         resource = self.get_resource(resource_name)
         perm = None
         if action and resource:
-            perm = (
-                self.appbuilder.get_session.query(self.permission_model)
-                .filter_by(action=action, resource=resource)
-                .first()
+            perm = self.appbuilder.get_session.scalar(
+                select(self.permission_model).filter_by(action=action, 
resource=resource)

Review Comment:
   made the change



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

Reply via email to