function ContentEntityBase::access

Same name in other branches
  1. 9 core/lib/Drupal/Core/Entity/ContentEntityBase.php \Drupal\Core\Entity\ContentEntityBase::access()
  2. 8.9.x core/lib/Drupal/Core/Entity/ContentEntityBase.php \Drupal\Core\Entity\ContentEntityBase::access()
  3. 11.x core/lib/Drupal/Core/Entity/ContentEntityBase.php \Drupal\Core\Entity\ContentEntityBase::access()

Overrides EntityBase::access

1 call to ContentEntityBase::access()
Node::access in core/modules/node/src/Entity/Node.php
1 method overrides ContentEntityBase::access()
Node::access in core/modules/node/src/Entity/Node.php

File

core/lib/Drupal/Core/Entity/ContentEntityBase.php, line 731

Class

ContentEntityBase
Implements Entity Field API specific enhancements to the Entity class.

Namespace

Drupal\Core\Entity

Code

public function access($operation, ?AccountInterface $account = NULL, $return_as_object = FALSE) {
    if ($operation == 'create') {
        return $this->entityTypeManager()
            ->getAccessControlHandler($this->entityTypeId)
            ->createAccess($this->bundle(), $account, [], $return_as_object);
    }
    return $this->entityTypeManager()
        ->getAccessControlHandler($this->entityTypeId)
        ->access($this, $operation, $account, $return_as_object);
}

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