diff --git a/core/modules/comment/src/CommentAccessControlHandler.php b/core/modules/comment/src/CommentAccessControlHandler.php
index 1706c85..c2382bd 100644
--- a/core/modules/comment/src/CommentAccessControlHandler.php
+++ b/core/modules/comment/src/CommentAccessControlHandler.php
@@ -71,18 +71,7 @@ protected function checkFieldAccess($operation, FieldDefinitionInterface $field_
       }
 
       // No user can change read-only fields.
-      $read_only_fields = array(
-        'hostname',
-        'uuid',
-        'cid',
-        'thread',
-        'comment_type',
-        'pid',
-        'entity_id',
-        'entity_type',
-        'field_name',
-      );
-      if (in_array($field_definition->getName(), $read_only_fields, TRUE)) {
+      if ($field_definition->isReadOnly()) {
         return AccessResult::forbidden();
       }
 
diff --git a/core/modules/comment/src/Entity/Comment.php b/core/modules/comment/src/Entity/Comment.php
index 8b24aba..7563271 100644
--- a/core/modules/comment/src/Entity/Comment.php
+++ b/core/modules/comment/src/Entity/Comment.php
@@ -248,6 +248,7 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
       ->setDescription(t('The user ID of the comment author.'))
       ->setTranslatable(TRUE)
       ->setSetting('target_type', 'user')
+      ->setDefaultValueCallback('Drupal\comment\Entity\Comment::getCurrentUserId')
       ->setDefaultValue(0);
 
     $fields['name'] = BaseFieldDefinition::create('string')
@@ -569,4 +570,16 @@ public function getTypeId() {
     return $this->bundle();
   }
 
+  /**
+   * Default value callback for 'uid' base field definition.
+   *
+   * @see ::baseFieldDefinitions()
+   *
+   * @return array
+   *   An array of default values.
+   */
+  public static function getCurrentUserId() {
+    return array(\Drupal::currentUser()->id());
+  }
+
 }
