isPublished()) { return AccessResult::allowedIfHasPermission($account, 'view unpublished heartbeat entities'); } return AccessResult::allowedIfHasPermission($account, 'view published heartbeat entities'); case 'update': return AccessResult::allowedIfHasPermission($account, 'edit heartbeat entities'); case 'delete': return AccessResult::allowedIfHasPermission($account, 'delete heartbeat entities'); } // Unknown operation, no opinion. return AccessResult::neutral(); } /** * {@inheritdoc} */ protected function checkCreateAccess(AccountInterface $account, array $context, $entity_bundle = NULL) { return AccessResult::allowedIfHasPermission($account, 'add heartbeat entities'); } }