Skip to content

AnalyticsServiceAccessControlHandler

Defines the access control handler for analytics services.

Adds the 'track' operation: whether an enabled service outputs on the current page, as its plugin decides. hook_analytics_service_access() can return forbidden to stop tracking, or allowed to track where the plugin is neutral, such as on admin routes.


  • Full name: \Drupal\analytics\AnalyticsServiceAccessControlHandler
  • Parent class: EntityAccessControlHandler

Methods

checkAccess

{@inheritdoc}

protected checkAccess(\Drupal\Core\Entity\EntityInterface $entity, mixed $operation, \Drupal\Core\Session\AccountInterface $account): \Drupal\Core\Access\AccessResultInterface

Parameters:

Parameter Type Description
$entity \Drupal\Core\Entity\EntityInterface
$operation mixed
$account \Drupal\Core\Session\AccountInterface