diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module
index 103c5c8..3fa4864 100644
--- a/core/modules/comment/comment.module
+++ b/core/modules/comment/comment.module
@@ -479,7 +479,7 @@ function comment_node_links_alter(array &$node_links, NodeInterface $node, array
               $links['comment-add'] += $node->urlInfo();
             }
           }
-          else {
+          elseif (\Drupal::currentUser()->isAnonymous()) {
             $links['comment-forbidden'] = array(
               'title' => \Drupal::service('comment.manager')->forbiddenMessage($node, $field_name),
               'html' => TRUE,
@@ -514,7 +514,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,
@@ -858,6 +858,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/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}
