code: def test_get_dashboards_api__user_get_only_published_permitted_dashboards(
      self,
  ):
      (
          new_role,
          draft_dashboards,
          published_dashboards,
      ) = self._create_sample_only_published_dashboard_with_roles()
  
      # act
      response = self.get_dashboards_api_response()
  
      # assert
      self.assert_dashboards_api_response(
          response,
          len(published_dashboards),
          published_dashboards,
          draft_dashboards,
      )
  
      # post
      for dash in published_dashboards + draft_dashboards:
          revoke_access_to_dashboard(dash, new_role)
  
imports: import json
  from unittest import mock
  from unittest.mock import patch
  import pytest
  from superset.commands.dashboard.exceptions import DashboardForbiddenError
  from superset.daos.dashboard import DashboardDAO
  from superset.utils.core import backend, override_user
  from tests.integration_tests.conftest import with_feature_flags
  from tests.integration_tests.dashboards.dashboard_test_utils import *
  from tests.integration_tests.dashboards.security.base_case import BaseTestDashboardSecurity
  from tests.integration_tests.dashboards.superset_factory_util import create_dashboard_to_db, create_database_to_db, create_datasource_table_to_db, create_slice_to_db
  from tests.integration_tests.fixtures.birth_names_dashboard import load_birth_names_dashboard_with_slices, load_birth_names_data
  from tests.integration_tests.fixtures.public_role import public_role_like_gamma
  from tests.integration_tests.fixtures.query_context import get_query_context
  from tests.integration_tests.fixtures.world_bank_dashboard import load_world_bank_dashboard_with_slices, load_world_bank_data
label_desc: Use image node_id 16 for calling the TestDashboardRoleBasedSecurity obj's underlying member method code with example usage: obj.test_get_dashboards_api__user_get_only_published_permitted_dashboards() without return types