function CommentAccessControlHandler::checkCreateAccess

Same name in other branches
  1. 9 core/modules/comment/src/CommentAccessControlHandler.php \Drupal\comment\CommentAccessControlHandler::checkCreateAccess()
  2. 8.9.x core/modules/comment/src/CommentAccessControlHandler.php \Drupal\comment\CommentAccessControlHandler::checkCreateAccess()
  3. 11.x core/modules/comment/src/CommentAccessControlHandler.php \Drupal\comment\CommentAccessControlHandler::checkCreateAccess()

Overrides EntityAccessControlHandler::checkCreateAccess

File

core/modules/comment/src/CommentAccessControlHandler.php, line 65

Class

CommentAccessControlHandler
Defines the access control handler for the comment entity type.

Namespace

Drupal\comment

Code

protected function checkCreateAccess(AccountInterface $account, array $context, $entity_bundle = NULL) {
    return AccessResult::allowedIfHasPermission($account, 'post comments');
}

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