class QueryAccessHandler in Entity API 8
Controls query access based on the generic entity permissions.
Hierarchy
- class \Drupal\entity\QueryAccess\QueryAccessHandlerBase implements EntityHandlerInterface, QueryAccessHandlerInterface
- class \Drupal\entity\QueryAccess\QueryAccessHandler
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\QueryAccessView 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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
QueryAccessHandler:: |
protected | function |
Builds the conditions for entities that have an owner. Overrides QueryAccessHandlerBase:: |
|
QueryAccessHandlerBase:: |
protected | property | The entity type bundle info. | |
QueryAccessHandlerBase:: |
protected | property | The current user. | |
QueryAccessHandlerBase:: |
protected | property | The entity type. | |
QueryAccessHandlerBase:: |
protected | property | The event dispatcher. | |
QueryAccessHandlerBase:: |
public | function | Builds the conditions for the given operation and user. | |
QueryAccessHandlerBase:: |
protected | function | Builds the conditions for entities that do not have an owner. | |
QueryAccessHandlerBase:: |
public static | function |
Instantiates a new instance of this entity handler. Overrides EntityHandlerInterface:: |
|
QueryAccessHandlerBase:: |
public | function |
Gets the conditions for the given operation and user. Overrides QueryAccessHandlerInterface:: |
|
QueryAccessHandlerBase:: |
public | function | Constructs a new QueryAccessHandlerBase object. |