diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module
index c3b4981..c9574bd 100644
--- a/core/modules/comment/comment.module
+++ b/core/modules/comment/comment.module
@@ -465,7 +465,7 @@ function comment_node_links_alter(array &$node_links, NodeInterface $node, array
               $links['comment-add'] += $node->urlInfo()->toArray();
             }
           }
-          else {
+          elseif (\Drupal::currentUser()->isAnonymous()) {
             $links['comment-forbidden'] = array(
               'title' => \Drupal::service('comment.manager')->forbiddenMessage($node, $field_name),
               'html' => TRUE,
@@ -500,7 +500,7 @@ function comment_node_links_alter(array &$node_links, NodeInterface $node, array
               }
             }
           }
-          else {
+          elseif (\Drupal::currentUser()->isAnonymous()) {
             $links['comment-forbidden'] = array(
               'title' => \Drupal::service('comment.manager')->forbiddenMessage($node, $field_name),
               'html' => TRUE,
@@ -844,6 +844,9 @@ function comment_translation_configuration_element_submit($form, &$form_state) {
  * @see \Drupal\comment\Plugin\Field\FieldType\CommentItem::propertyDefinitions()
  */
 function comment_entity_load($entities, $entity_type) {
+  if (!\Drupal::entityManager()->getDefinition($entity_type)->isSubclassOf('Drupal\Core\Entity\ContentEntityInterface')) {
+    return;
+  }
   if (!\Drupal::service('comment.manager')->getFields($entity_type)) {
     // Do not query database when entity has no comment fields.
     return;
diff --git a/core/modules/comment/comment.services.yml b/core/modules/comment/comment.services.yml
index 8524045..76fdbc4 100644
--- a/core/modules/comment/comment.services.yml
+++ b/core/modules/comment/comment.services.yml
@@ -7,7 +7,7 @@ services:
 
   comment.manager:
     class: Drupal\comment\CommentManager
-    arguments: ['@field.info', '@entity.manager', '@current_user', '@config.factory', '@string_translation', '@url_generator']
+    arguments: ['@field.info', '@entity.manager', '@config.factory', '@string_translation', '@url_generator']
 
   comment.statistics:
     class: Drupal\comment\CommentStatistics
diff --git a/core/modules/comment/lib/Drupal/comment/CommentManager.php b/core/modules/comment/lib/Drupal/comment/CommentManager.php
index c522fd3..fcb3277 100644
--- a/core/modules/comment/lib/Drupal/comment/CommentManager.php
+++ b/core/modules/comment/lib/Drupal/comment/CommentManager.php
@@ -37,13 +37,6 @@ class CommentManager implements CommentManagerInterface {
   protected $entityManager;
 
   /**
-   * The current user.
-   *
-   * @var \Drupal\Core\Session\AccountInterface $current_user
-   */
-  protected $currentUser;
-
-  /**
    * Whether the DRUPAL_AUTHENTICATED_RID can post comments.
    *
    * @var bool
@@ -78,8 +71,6 @@ class CommentManager implements CommentManagerInterface {
    *   The field info service.
    * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
    *   The entity manager service.
-   * @param \Drupal\Core\Session\AccountInterface $current_user
-   *   The current user.
    * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
    *   The config factory.
    * @param \Drupal\Core\StringTranslation\TranslationInterface $translation_manager
@@ -87,10 +78,9 @@ class CommentManager implements CommentManagerInterface {
    * @param \Drupal\Core\Routing\UrlGeneratorInterface $url_generator
    *   The url generator service.
    */
-  public function __construct(FieldInfo $field_info, EntityManagerInterface $entity_manager, AccountInterface $current_user, ConfigFactoryInterface $config_factory, TranslationInterface $translation_manager, UrlGeneratorInterface $url_generator) {
+  public function __construct(FieldInfo $field_info, EntityManagerInterface $entity_manager, ConfigFactoryInterface $config_factory, TranslationInterface $translation_manager, UrlGeneratorInterface $url_generator) {
     $this->fieldInfo = $field_info;
     $this->entityManager = $entity_manager;
-    $this->currentUser = $current_user;
     $this->userConfig = $config_factory->get('user.settings');
     $this->translationManager = $translation_manager;
     $this->urlGenerator = $url_generator;
@@ -277,39 +267,37 @@ public function getFieldUIPageTitle($commented_entity_type, $field_name) {
    * {@inheritdoc}
    */
   public function forbiddenMessage(EntityInterface $entity, $field_name) {
-    if ($this->currentUser->isAnonymous()) {
-      if (!isset($this->authenticatedCanPostComments)) {
-        // We only output a link if we are certain that users will get the
-        // permission to post comments by logging in.
-        $this->authenticatedCanPostComments = $this->entityManager
-          ->getStorage('user_role')
-          ->load(DRUPAL_AUTHENTICATED_RID)
-          ->hasPermission('post comments');
-      }
+    if (!isset($this->authenticatedCanPostComments)) {
+      // We only output a link if we are certain that users will get the
+      // permission to post comments by logging in.
+      $this->authenticatedCanPostComments = $this->entityManager
+        ->getStorage('user_role')
+        ->load(DRUPAL_AUTHENTICATED_RID)
+        ->hasPermission('post comments');
+    }
 
-      if ($this->authenticatedCanPostComments) {
-        // We cannot use drupal_get_destination() because these links
-        // sometimes appear on /node and taxonomy listing pages.
-        if ($entity->get($field_name)->getFieldDefinition()->getSetting('form_location') == COMMENT_FORM_SEPARATE_PAGE) {
-          $destination = array('destination' => 'comment/reply/' . $entity->getEntityTypeId() . '/' . $entity->id() . '/' . $field_name . '#comment-form');
-        }
-        else {
-          $destination = array('destination' => $entity->getSystemPath() . '#comment-form');
-        }
+    if ($this->authenticatedCanPostComments) {
+      // We cannot use drupal_get_destination() because these links
+      // sometimes appear on /node and taxonomy listing pages.
+      if ($entity->get($field_name)->getFieldDefinition()->getSetting('form_location') == COMMENT_FORM_SEPARATE_PAGE) {
+        $destination = array('destination' => 'comment/reply/' . $entity->getEntityTypeId() . '/' . $entity->id() . '/' . $field_name . '#comment-form');
+      }
+      else {
+        $destination = array('destination' => $entity->getSystemPath() . '#comment-form');
+      }
 
-        if ($this->userConfig->get('register') != USER_REGISTER_ADMINISTRATORS_ONLY) {
-          // Users can register themselves.
-          return $this->t('<a href="@login">Log in</a> or <a href="@register">register</a> to post comments', array(
-            '@login' => $this->urlGenerator->generateFromRoute('user.login', array(), array('query' => $destination)),
-            '@register' => $this->urlGenerator->generateFromRoute('user.register', array(), array('query' => $destination)),
-          ));
-        }
-        else {
-          // Only admins can add new users, no public registration.
-          return $this->t('<a href="@login">Log in</a> to post comments', array(
-            '@login' => $this->urlGenerator->generateFromRoute('user.login', array(), array('query' => $destination)),
-          ));
-        }
+      if ($this->userConfig->get('register') != USER_REGISTER_ADMINISTRATORS_ONLY) {
+        // Users can register themselves.
+        return $this->t('<a href="@login">Log in</a> or <a href="@register">register</a> to post comments', array(
+          '@login' => $this->urlGenerator->generateFromRoute('user.login', array(), array('query' => $destination)),
+          '@register' => $this->urlGenerator->generateFromRoute('user.register', array(), array('query' => $destination)),
+        ));
+      }
+      else {
+        // Only admins can add new users, no public registration.
+        return $this->t('<a href="@login">Log in</a> to post comments', array(
+          '@login' => $this->urlGenerator->generateFromRoute('user.login', array(), array('query' => $destination)),
+        ));
       }
     }
     return '';
diff --git a/core/modules/comment/lib/Drupal/comment/CommentViewBuilder.php b/core/modules/comment/lib/Drupal/comment/CommentViewBuilder.php
index 3661080..da28f7b 100644
--- a/core/modules/comment/lib/Drupal/comment/CommentViewBuilder.php
+++ b/core/modules/comment/lib/Drupal/comment/CommentViewBuilder.php
@@ -241,14 +241,14 @@ protected static function buildLinks(CommentInterface $entity, EntityInterface $
           'html' => TRUE,
         );
       }
-      if (empty($links)) {
+      if (empty($links) && \Drupal::currentUser()->isAnonymous()) {
         $links['comment-forbidden']['title'] = \Drupal::service('comment.manager')->forbiddenMessage($commented_entity, $entity->getFieldName());
         $links['comment-forbidden']['html'] = TRUE;
       }
     }
 
     // Add translations link for translation-enabled comment bundles.
-    if ($container->get('module_handler')->moduleExists('content_translation') && content_translation_translate_access($entity)) {
+    if (\Drupal::moduleHandler()->moduleExists('content_translation') && content_translation_translate_access($entity)) {
       $links['comment-translations'] = array(
         'title' => t('Translate'),
         'href' => 'comment/' . $entity->id() . '/translations',
diff --git a/core/modules/rest/lib/Drupal/rest/Tests/AuthTest.php b/core/modules/rest/lib/Drupal/rest/Tests/AuthTest.php
index 3add3aa..a1ae295 100644
--- a/core/modules/rest/lib/Drupal/rest/Tests/AuthTest.php
+++ b/core/modules/rest/lib/Drupal/rest/Tests/AuthTest.php
@@ -19,7 +19,7 @@ class AuthTest extends RESTTestBase {
    *
    * @var array
    */
-  public static $modules = array('basic_auth', 'hal', 'rest', 'entity_test');
+  public static $modules = array('basic_auth', 'hal', 'rest', 'entity_test', 'comment');
 
   /**
    * {@inheritdoc}
