You are here

class QueryAccessHandler in Entity API 8

Controls query access based on the generic entity permissions.

Hierarchy

Expanded class hierarchy of QueryAccessHandler

See also

\Drupal\entity\EntityAccessControlHandler

\Drupal\entity\EntityPermissionProvider

2 files declare their use of QueryAccessHandler
QueryAccessEventTest.php in tests/src/Kernel/QueryAccess/QueryAccessEventTest.php
QueryAccessHandlerTest.php in tests/src/Kernel/QueryAccess/QueryAccessHandlerTest.php

File

src/QueryAccess/QueryAccessHandler.php, line 13

Namespace

Drupal\entity\QueryAccess
View source
class QueryAccessHandler extends QueryAccessHandlerBase {

  /**
   * {@inheritdoc}
   */
  protected function buildEntityOwnerConditions($operation, AccountInterface $account) {
    if ($operation == 'view') {

      // EntityPermissionProvider doesn't provide own/any view permissions.
      return $this
        ->buildEntityConditions($operation, $account);
    }
    return parent::buildEntityOwnerConditions($operation, $account);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
QueryAccessHandler::buildEntityOwnerConditions protected function Builds the conditions for entities that have an owner. Overrides QueryAccessHandlerBase::buildEntityOwnerConditions
QueryAccessHandlerBase::$bundleInfo protected property The entity type bundle info.
QueryAccessHandlerBase::$currentUser protected property The current user.
QueryAccessHandlerBase::$entityType protected property The entity type.
QueryAccessHandlerBase::$eventDispatcher protected property The event dispatcher.
QueryAccessHandlerBase::buildConditions public function Builds the conditions for the given operation and user.
QueryAccessHandlerBase::buildEntityConditions protected function Builds the conditions for entities that do not have an owner.
QueryAccessHandlerBase::createInstance public static function Instantiates a new instance of this entity handler. Overrides EntityHandlerInterface::createInstance
QueryAccessHandlerBase::getConditions public function Gets the conditions for the given operation and user. Overrides QueryAccessHandlerInterface::getConditions
QueryAccessHandlerBase::__construct public function Constructs a new QueryAccessHandlerBase object.