class_docstr: Flask-AppBuilder auth manager.
  
  This auth manager is responsible for providing a backward compatible user management experience to users.
docstr: Return whether the user is authorized to access the dag.
  
  There are multiple scenarios:
  
  1. ``dag_access`` is not provided which means the user wants to access the DAG itself and not a sub
  entity (e.g. DAG runs).
  2. ``dag_access`` is provided which means the user wants to access a sub entity of the DAG
  (e.g. DAG runs).
  
      a. If ``method`` is GET, then check the user has READ permissions on the DAG and the sub entity.
      b. Else, check the user has EDIT permissions on the DAG and ``method`` on the sub entity. However,
          if no specific DAG is targeted, just check the sub entity.
  
  :param method: The method to authorize.
  :param access_entity: The dag access entity.
  :param details: The dag details.
  :param user: The user.
docstr_tok: ["Return","whether","the","user","is","authorized","to","access","the","dag",".","There","are","multiple","scenarios",":","1",".","``","dag_access","``","is","not","provided","which","means","the","user","wants","to","access","the","DAG","itself","and","not","a","sub","entity","(","e.g",".","DAG","runs",")",".","2",".","``","dag_access","``","is","provided","which","means","the","user","wants","to","access","a","sub","entity","of","the","DAG","(","e.g",".","DAG","runs",")",".","a",".","If","``","method","``","is","GET",",","then","check","the","user","has","READ","permissions","on","the","DAG","and","the","sub","entity",".","b",".","Else",",","check","the","user","has","EDIT","permissions","on","the","DAG","and","``","method","``","on","the","sub","entity",".","However",",","if","no","specific","DAG","is","targeted",",","just","check","the","sub","entity",".",":","param","method",":","The","method","to","authorize",".",":","param","access_entity",":","The","dag","access","entity",".",":","param","details",":","The","dag","details",".",":","param","user",":","The","user","."]
code: def is_authorized_dag(
      self,
      *,
      method: ResourceMethod,
      access_entity: DagAccessEntity | None = None,
      details: DagDetails | None = None,
      user: BaseUser | None = None,
  ) -> bool:
      """
      Return whether the user is authorized to access the dag.
  
      There are multiple scenarios:
  
      1. ``dag_access`` is not provided which means the user wants to access the DAG itself and not a sub
      entity (e.g. DAG runs).
      2. ``dag_access`` is provided which means the user wants to access a sub entity of the DAG
      (e.g. DAG runs).
  
          a. If ``method`` is GET, then check the user has READ permissions on the DAG and the sub entity.
          b. Else, check the user has EDIT permissions on the DAG and ``method`` on the sub entity. However,
              if no specific DAG is targeted, just check the sub entity.
  
      :param method: The method to authorize.
      :param access_entity: The dag access entity.
      :param details: The dag details.
      :param user: The user.
      """
      if not access_entity:
          # Scenario 1
          return self._is_authorized_dag(
              method=method, details=details, user=user
          )
      else:
          # Scenario 2
          resource_types = self._get_fab_resource_types(access_entity)
          dag_method: ResourceMethod = (
              "GET" if method == "GET" else "PUT"
          )
  
          if (details and details.id) and not self._is_authorized_dag(
              method=dag_method, details=details, user=user
          ):
              return False
  
          return all(
              self._is_authorized(
                  method=method, resource_type=resource_type, user=user
              )
              for resource_type in resource_types
          )
  
imports: from __future__ import annotations
  import argparse
  from functools import cached_property
  from pathlib import Path
  from typing import TYPE_CHECKING, Container
  from connexion import FlaskApi
  from flask import Blueprint, url_for
  from sqlalchemy import select
  from sqlalchemy.orm import Session, joinedload
  from airflow.auth.managers.base_auth_manager import BaseAuthManager, ResourceMethod
  from airflow.auth.managers.models.resource_details import AccessView, ConfigurationDetails, ConnectionDetails, DagAccessEntity, DagDetails, DatasetDetails, PoolDetails, VariableDetails
  from airflow.auth.managers.utils.fab import get_fab_action_from_method_map, get_method_from_fab_action_map
  from airflow.cli.cli_config import DefaultHelpParser, GroupCommand
  from airflow.configuration import conf
  from airflow.exceptions import AirflowException
  from airflow.models import DagModel
  from airflow.providers.fab.auth_manager.cli_commands.definition import ROLES_COMMANDS, SYNC_PERM_COMMAND, USERS_COMMANDS
  from airflow.providers.fab.auth_manager.models import Permission, Role, User
  from airflow.security import permissions
  from airflow.security.permissions import ACTION_CAN_ACCESS_MENU, ACTION_CAN_READ, RESOURCE_AUDIT_LOG, RESOURCE_CLUSTER_ACTIVITY, RESOURCE_CONFIG, RESOURCE_CONNECTION, RESOURCE_DAG, RESOURCE_DAG_CODE, RESOURCE_DAG_DEPENDENCIES, RESOURCE_DAG_PREFIX, RESOURCE_DAG_RUN, RESOURCE_DAG_WARNING, RESOURCE_DATASET, RESOURCE_DOCS, RESOURCE_IMPORT_ERROR, RESOURCE_JOB, RESOURCE_PLUGIN, RESOURCE_POOL, RESOURCE_PROVIDER, RESOURCE_SLA_MISS, RESOURCE_TASK_INSTANCE, RESOURCE_TASK_LOG, RESOURCE_TASK_RESCHEDULE, RESOURCE_TRIGGER, RESOURCE_VARIABLE, RESOURCE_WEBSITE, RESOURCE_XCOM
  from airflow.utils.session import NEW_SESSION, provide_session
  from airflow.utils.yaml import safe_load
  from airflow.www.extensions.init_views import _CustomErrorRequestBodyValidator, _LazyResolver
label_desc: Use image node_id 9 for calling the FabAuthManager obj's underlying member method code with example usage: obj.is_authorized_dag() and returns: self, all, False