You are here

function core_event_dispatcher_entity_access in Hook Event Dispatcher 8.2

Same name and namespace in other branches
  1. 3.x modules/core_event_dispatcher/core_event_dispatcher.module \core_event_dispatcher_entity_access()

Implements hook_entity_access().

5 calls to core_event_dispatcher_entity_access()
EntityAccessEventTest::testEntityAccessEventAllowedResult in modules/core_event_dispatcher/tests/src/Unit/Entity/EntityAccessEventTest.php
EntityAccessEvent with allowed result test.
EntityAccessEventTest::testEntityAccessEventCombinedResults in modules/core_event_dispatcher/tests/src/Unit/Entity/EntityAccessEventTest.php
EntityAccessEvent with combined results test.
EntityAccessEventTest::testEntityAccessEventForbiddenResult in modules/core_event_dispatcher/tests/src/Unit/Entity/EntityAccessEventTest.php
EntityAccessEvent with forbidden result test.
EntityAccessEventTest::testEntityAccessEventNeutralResult in modules/core_event_dispatcher/tests/src/Unit/Entity/EntityAccessEventTest.php
EntityAccessEvent with neutral result test.
EntityAccessEventTest::testEntityAccessEventWithNoChanges in modules/core_event_dispatcher/tests/src/Unit/Entity/EntityAccessEventTest.php
EntityAccessEvent with no changes test.

File

modules/core_event_dispatcher/core_event_dispatcher.module, line 156
Core event dispatcher submodule.

Code

function core_event_dispatcher_entity_access(EntityInterface $entity, string $operation, AccountInterface $account) {

  /** @var \Drupal\hook_event_dispatcher\Manager\HookEventDispatcherManagerInterface $manager */
  $manager = Drupal::service('hook_event_dispatcher.manager');
  $event = new EntityAccessEvent($entity, $operation, $account);
  $manager
    ->register($event);
  return $event
    ->getAccessResult();
}