/**
  * {@inheritdoc}
  *
  * @param \Drupal\rng\GroupInterface $entity
  *   A group entity.
  */
 protected function checkAccess(EntityInterface $entity, $operation, AccountInterface $account)
 {
     $account = $this->prepareUser($account);
     $event = $entity->getEvent();
     if (!$entity->isUserGenerated() && $operation == 'delete') {
         return AccessResult::forbidden();
     }
     if ($event) {
         return $event->access('manage event', $account, TRUE);
     }
     return AccessResult::neutral();
 }
 /**
  * {@inheritdoc}
  */
 public function buildRow(EntityInterface $entity)
 {
     $row['label'] = $entity->label();
     $row['source'] = $entity->isUserGenerated() ? t('User') : t('System');
     $row['description'] = MailFormatHelper::htmlToText($entity->getDescription());
     return $row + parent::buildRow($entity);
 }