Access controller for the comment entity.
Expanded class hierarchy of CommentAccessController
\Drupal\comment\Plugin\Core\Entity\Comment.
class CommentAccessController extends EntityAccessController {
  /**
   * {@inheritdoc}
   */
  protected function checkAccess(EntityInterface $entity, $operation, $langcode, AccountInterface $account) {
    switch ($operation) {
      case 'view':
        return user_access('access comments', $account);
        break;
      case 'create':
        return user_access('post comments', $account);
        break;
      case 'update':
        return $account->uid && $account->uid == $entity->uid->value && $entity->status->value == COMMENT_PUBLISHED && user_access('edit own comments', $account) || user_access('administer comments', $account);
        break;
      case 'delete':
        return user_access('administer comments', $account);
        break;
      case 'approve':
        return user_access('administer comments', $account);
        break;
    }
  }
}| 
            Name | 
                  Modifiers | Type | Description | Overrides | 
|---|---|---|---|---|
| 
            CommentAccessController:: | 
                  protected | function | 
            Performs access checks. Overrides EntityAccessController:: | 
                  |
| 
            EntityAccessController:: | 
                  protected | property | Stores calculcated access check results. | |
| 
            EntityAccessController:: | 
                  public | function | 
            Checks access to an operation on a given entity or entity translation. Overrides EntityAccessControllerInterface:: | 
                  1 | 
| 
            EntityAccessController:: | 
                  protected | function | Tries to retrieve a previously cached access value from the static cache. | |
| 
            EntityAccessController:: | 
                  public | function | 
            Clears all cached access checks. Overrides EntityAccessControllerInterface:: | 
                  |
| 
            EntityAccessController:: | 
                  protected | function | Statically caches whether the given user has access. |