CommentHalJsonAnonTest::$patchProtectedFieldNames

Same name in other branches
  1. 8.9.x core/modules/comment/tests/src/Functional/Hal/CommentHalJsonAnonTest.php \Drupal\Tests\comment\Functional\Hal\CommentHalJsonAnonTest::patchProtectedFieldNames

Anonymous users cannot edit their own comments.

Type: patchProtectedFieldNames

Overrides CommentHalJsonTestBase::$patchProtectedFieldNames

See also

\Drupal\comment\CommentAccessControlHandler::checkAccess

Therefore we grant them the 'administer comments' permission for the purpose of this test. Then they are able to edit their own comments, but some fields are still not editable, even with that permission.

::setUpAuthorization

File

core/modules/hal/tests/src/Functional/comment/CommentHalJsonAnonTest.php, line 33

Class

CommentHalJsonAnonTest
@group hal @group legacy

Namespace

Drupal\Tests\hal\Functional\comment

Code

protected static $patchProtectedFieldNames = [
    'changed' => NULL,
    'thread' => NULL,
    'entity_type' => NULL,
    'field_name' => NULL,
    'entity_id' => NULL,
];

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.