class_docstr: Custom security manager, which introduces a permission model adapted to Airflow.
  
  It's named V2 to differentiate it from the obsolete airflow.www.security.AirflowSecurityManager.
class_docstr_tok: ["Custom","security","manager",",","which","introduces","a","permission","model","adapted","to","Airflow",".","It","'s","named","V2","to","differentiate","it","from","the","obsolete","airflow.www.security.AirflowSecurityManager","."]
code: def _get_auth_manager_is_authorized_method(
      self, fab_resource_name: str
  ) -> Callable:
      is_authorized_method = self._auth_manager_is_authorized_map.get(
          fab_resource_name
      )
      if is_authorized_method:
          return is_authorized_method
      elif fab_resource_name in [
          RESOURCE_DOCS_MENU,
          RESOURCE_ADMIN_MENU,
          RESOURCE_BROWSE_MENU,
      ]:
          # Display the "Browse", "Admin" and "Docs" dropdowns in the menu if the user has access to at
          # least one dropdown child
          return self._is_authorized_category_menu(fab_resource_name)
      else:
          # This means the page the user is trying to access is specific to the auth manager used
          # Example: the user list view in FabAuthManager
          return lambda action, resource_pk, user: get_auth_manager().is_authorized_custom_view(
              fab_action_name=ACTION_CAN_READ
              if action == ACTION_CAN_ACCESS_MENU
              else action,
              fab_resource_name=fab_resource_name,
              user=user,
          )
  
imports: from __future__ import annotations
  import json
  from functools import cached_property
  from typing import TYPE_CHECKING, Callable
  from flask import g
  from flask_limiter import Limiter
  from flask_limiter.util import get_remote_address
  from sqlalchemy import select
  from airflow.auth.managers.models.resource_details import AccessView, ConnectionDetails, DagAccessEntity, DagDetails, PoolDetails, VariableDetails
  from airflow.auth.managers.utils.fab import get_method_from_fab_action_map
  from airflow.exceptions import AirflowException
  from airflow.models import Connection, DagRun, Pool, TaskInstance, Variable
  from airflow.security.permissions import ACTION_CAN_ACCESS_MENU, ACTION_CAN_READ, RESOURCE_ADMIN_MENU, RESOURCE_AUDIT_LOG, RESOURCE_BROWSE_MENU, RESOURCE_CLUSTER_ACTIVITY, RESOURCE_CONFIG, RESOURCE_CONNECTION, RESOURCE_DAG, RESOURCE_DAG_CODE, RESOURCE_DAG_DEPENDENCIES, RESOURCE_DAG_RUN, RESOURCE_DATASET, RESOURCE_DOCS, RESOURCE_DOCS_MENU, RESOURCE_JOB, RESOURCE_PLUGIN, RESOURCE_POOL, RESOURCE_PROVIDER, RESOURCE_SLA_MISS, RESOURCE_TASK_INSTANCE, RESOURCE_TASK_RESCHEDULE, RESOURCE_TRIGGER, RESOURCE_VARIABLE, RESOURCE_XCOM
  from airflow.utils.log.logging_mixin import LoggingMixin
  from airflow.utils.session import NEW_SESSION, provide_session
  from airflow.www.extensions.init_auth_manager import get_auth_manager
  from airflow.www.utils import CustomSQLAInterface
label_desc: Use image node_id 9 for calling the AirflowSecurityManagerV2 obj's underlying member method code with example usage: obj._get_auth_manager_is_authorized_method(fab_resource_name) and returns: is_authorized_method, self, function