Added Entity and Entity Reference Revisions which got dropped somewhere along the...
[yaffs-website] / web / modules / contrib / entity / src / QueryAccess / QueryAccessHandler.php
1 <?php
2
3 namespace Drupal\entity\QueryAccess;
4
5 use Drupal\Core\Session\AccountInterface;
6
7 /**
8  * Controls query access based on the generic entity permissions.
9  *
10  * @see \Drupal\entity\EntityAccessControlHandler
11  * @see \Drupal\entity\EntityPermissionProvider
12  */
13 class QueryAccessHandler extends QueryAccessHandlerBase {
14
15   /**
16    * {@inheritdoc}
17    */
18   protected function buildEntityOwnerConditions($operation, AccountInterface $account) {
19     if ($operation == 'view') {
20       // EntityPermissionProvider doesn't provide own/any view permissions.
21       return $this->buildEntityConditions($operation, $account);
22     }
23
24     return parent::buildEntityOwnerConditions($operation, $account);
25   }
26
27 }