code: def permission_allowed(datasette, actor, action):
      # Testing asyncio version of permission_allowed
      async def inner():
          assert (
              2
              == (
                  await datasette.get_internal_database().execute(
                      "select 1 + 1"
                  )
              ).first()[0]
          )
          if action == "this_is_allowed_async":
              return True
          elif action == "this_is_denied_async":
              return False
  
      return inner
  
file_path: datasette/tests/plugins/my_plugin_2.py
imports: from datasette import hookimpl
  from datasette.utils.asgi import Response
  from functools import wraps
  import markupsafe
  import json
label_desc: Use image node_id 6 for calling a global function with example usage: permission_allowed(datasette, actor, action) and returns: inner, True, False