Hide content type property based on role

I have a content entity called Event and a basic custom module in 8.6.10. One of the entity’s fields should only be seen by a few roles, especially in the edit form.

I thought I could create a new view mode for the form, but it’s not clear to me how to restrict this view mode to these roles.

Searching I see someone suggesting field_permission_hooks to do this. The closest my search got was hook_entity_field_access(). Reading its doc page, it’s used in content moderation. I suspect my function should reside in the event.module file and not in a Controller. How DO we decide where to put our functions that we pull in?

This is my implementation and it seems to be ignored, or just not invoked, on a page load.

use DrupalCoreRoutingRouteMatchInterface;
use DrupalCoreEntityEntityAccessControlHandler;
use DrupalCoreFieldFieldDefinitionInterface;
use DrupalCoreSessionAccountInterface;
use DrupalCoreFieldFieldItemListInterface;
use DrupalCoreExtensionModuleHandlerInterface;
use DrupalCoreEntityDisplayEntityViewDisplayInterface;
use DrupalCoreEntityEntityInterface;

 * Implements hook_help().
function event_help($route_name, RouteMatchInterface $route_match) {
  switch ($route_name) {
    // Main module help for the event module.
    case 'help.page.event':
      $output = '';
      $output .= '<h3>' . t('About') . '</h3>';
      $output .= '<p>' . t('Event manager') . '</p>';
      return $output;


 * Implements hook_entity_field_access().
function event_entity_field_access($op, FieldDefinitionInterface $field_definition, AccountInterface $account, FieldItemListInterface $items = NULL ) {
  if ($items && $op === 'edit'){
      $entity_type = Drupal::entityTypeManager()->getDefinition($field_definition->getTargetEntityTypeId());

      $entity = $items->getEntity();


I figure I ought to get several devel outputs for many fields so I can discover and filter them, like I would in D7. But it skips past this function after a drush cr

What am I doing wrong here? Or is there a better way?

thx, sam

Drupal version: 

Source: https://www.drupal.org/taxonomy/term/4/feed