services:

    permissions_by_term.kernel_event_listener:
      class: Drupal\permissions_by_term\Listener\KernelEventListener
      arguments: ['@permissions_by_term.access_check', '@permissions_by_term.access_storage', '@permissions_by_term.term_handler', '@event_dispatcher', '@page_cache_kill_switch', '@config.factory']
      tags:
          - { name: event_subscriber }

    permissions_by_term.access_check:
      class: Drupal\permissions_by_term\Service\AccessCheck
      arguments: ['@database', '@event_dispatcher', '@entity_field.manager']

    permissions_by_term.access_storage:
      class: Drupal\permissions_by_term\Service\AccessStorage
      arguments: ['@database', '@permissions_by_term.term_handler', '@permissions_by_term.access_check', '@permissions_by_term.key_value_cache']

    permissions_by_term.node_access_record_factory:
      class: \Drupal\permissions_by_term\Factory\NodeAccessRecordFactory

    permissions_by_term.node_access:
      class: \Drupal\permissions_by_term\Service\NodeAccess
      arguments: ['@permissions_by_term.access_storage', '@permissions_by_term.node_access_record_factory', '@entity_type.manager', '@permissions_by_term.access_check', '@database']

    permissions_by_term.term_handler:
      class: \Drupal\permissions_by_term\Service\TermHandler
      arguments: ['@database', '@entity_field.manager', '@entity_type.manager']

    permissions_by_term.node_entity_bundle_info:
      class: \Drupal\permissions_by_term\Service\NodeEntityBundleInfo
      arguments: ['@permissions_by_term.access_storage', '@permissions_by_term.term_handler', '@twig', '@database']

    logger.channel.permissions_by_term:
      class: Drupal\Core\Logger\LoggerChannel
      factory: logger.factory:get
      arguments: ['permissions_by_term']

    cache.permissions_by_term:
      class: Drupal\Core\Cache\CacheBackendInterface
      tags:
        - { name: cache.bin }
      factory: cache_factory:get
      arguments:
        - permissions_by_term

    permissions_by_term.access_result_cache:
      class: Drupal\permissions_by_term\Cache\AccessResultCache
      arguments: ['@cache.permissions_by_term']

    permissions_by_term.key_value_cache:
      class: Drupal\permissions_by_term\Cache\KeyValueCache
      arguments: ['@cache.permissions_by_term']

    permissions_by_term.cache_invalidator:
      class: Drupal\permissions_by_term\Cache\CacheInvalidator
      arguments: ['@cache_tags.invalidator']
