code: def test_get_permitted_dag_ids(
      self,
      auth_manager,
      access_all: bool,
      access_per_dag: dict,
      dag_ids: list,
      expected: set,
  ):
      def side_effect_func(
          *,
          method: ResourceMethod,
          access_entity: DagAccessEntity | None = None,
          details: DagDetails | None = None,
          user: BaseUser | None = None,
      ):
          if not details:
              return access_all
          else:
              return access_per_dag.get(details.id, False)
  
      auth_manager.is_authorized_dag = MagicMock(
          side_effect=side_effect_func
      )
      user = Mock()
      session = Mock()
      dags = []
      for dag_id in dag_ids:
          mock = Mock()
          mock.dag_id = dag_id
          dags.append(mock)
      session.execute.return_value = dags
      result = auth_manager.get_permitted_dag_ids(
          user=user, session=session
      )
      assert result == expected
  
imports: from __future__ import annotations
  from typing import TYPE_CHECKING
  from unittest.mock import MagicMock, Mock, patch
  import pytest
  from flask import Flask
  from airflow.auth.managers.base_auth_manager import BaseAuthManager, ResourceMethod
  from airflow.auth.managers.models.resource_details import ConnectionDetails, DagDetails, PoolDetails, VariableDetails
  from airflow.exceptions import AirflowException
  from airflow.security import permissions
  from airflow.www.extensions.init_appbuilder import init_appbuilder
  from airflow.www.security_manager import AirflowSecurityManagerV2
label_desc: Use image node_id 15 for calling the TestBaseAuthManager obj's underlying member method code with example usage: obj.test_get_permitted_dag_ids(auth_manager, access_all, access_per_dag, dag_ids, expected) and returns: access_all, access_per_dag