get('handlers'); $handlers['route_provider']['html_diff'] = DiffRouteProvider::class; $entity_type->set('handlers', $handlers); $entity_type->setLinkTemplate('revisions-diff', "/entity_test_rev/{entity_test_rev}/revision/{left_revision}/{right_revision}"); } /** * Implements hook_entity_field_access(). */ function diff_test_entity_field_access($operation, FieldDefinitionInterface $field_definition, AccountInterface $account, FieldItemListInterface $items = NULL) { if ($field_definition->getName() == 'field_diff_deny_access') { return AccessResult::forbidden(); } return AccessResult::allowed(); }