/**
  * {@inheritdoc}
  */
 protected function buildEntityQuery($match = NULL, $match_operator = 'CONTAINS')
 {
     $query = parent::buildEntityQuery($match, $match_operator);
     if (($event = $this->configuration['entity']) instanceof EntityInterface) {
         $group = $query->andConditionGroup()->condition('event__target_type', $event->getEntityTypeId(), '=')->condition('event__target_id', $event->id(), '=');
         $query->condition($group);
         $query->condition('source', NULL, 'IS NULL');
     }
     return $query;
 }
 /**
  * {@inheritdoc}
  */
 protected function buildEntityQuery($match = NULL, $match_operator = 'CONTAINS')
 {
     $query = parent::buildEntityQuery($match, $match_operator);
     // Adding the 'comment_access' tag is sadly insufficient for comments:
     // core requires us to also know about the concept of 'published' and
     // 'unpublished'.
     if (!$this->currentUser->hasPermission('administer comments')) {
         $query->condition('status', CommentInterface::PUBLISHED);
     }
     return $query;
 }
Exemple #3
0
 /**
  * {@inheritdoc}
  */
 protected function buildEntityQuery($match = NULL, $match_operator = 'CONTAINS')
 {
     $query = parent::buildEntityQuery($match, $match_operator);
     // Adding the 'node_access' tag is sadly insufficient for nodes: core
     // requires us to also know about the concept of 'published' and
     // 'unpublished'. We need to do that as long as there are no access control
     // modules in use on the site. As long as one access control module is there,
     // it is supposed to handle this check.
     if (!$this->currentUser->hasPermission('bypass node access') && !count($this->moduleHandler->getImplementations('node_grants'))) {
         $query->condition('status', NODE_PUBLISHED);
     }
     return $query;
 }
 /**
  * {@inheritdoc}
  */
 protected function buildEntityQuery($match = NULL, $match_operator = 'CONTAINS')
 {
     $query = parent::buildEntityQuery($match, $match_operator);
     if (($registration_group = $this->configuration['entity']) instanceof GroupInterface) {
         /** @var GroupInterface $registration_group */
         if (($event = $registration_group->getEvent()) instanceof EntityInterface) {
             $group = $query->andConditionGroup()->condition('event__target_type', $event->getEntityTypeId(), '=')->condition('event__target_id', $event->id(), '=');
             $query->condition($group);
         }
         $id_key = $registration_group->getEntityType()->getKey('id');
         $query->condition($id_key, [$registration_group->id()], 'NOT IN');
     }
     $query->condition('source', NULL, 'IS NULL');
     return $query;
 }
Exemple #5
0
 /**
  * {@inheritdoc}
  */
 protected function buildEntityQuery($match = NULL, $match_operator = 'CONTAINS')
 {
     $query = parent::buildEntityQuery($match, $match_operator);
     // The user entity doesn't have a label column.
     if (isset($match)) {
         $query->condition('name', $match, $match_operator);
     }
     // Filter by role.
     $handler_settings = $this->configuration['handler_settings'];
     if (!empty($handler_settings['filter']['role'])) {
         $query->condition('roles', $handler_settings['filter']['role'], 'IN');
     }
     // Adding the permission check is sadly insufficient for users: core
     // requires us to also know about the concept of 'blocked' and 'active'.
     if (!$this->currentUser->hasPermission('administer users')) {
         $query->condition('status', 1);
     }
     return $query;
 }
 /**
  * {@inheritdoc}
  */
 protected function buildEntityQuery($match = NULL, $match_operator = 'CONTAINS')
 {
     $query = parent::buildEntityQuery($match, $match_operator);
     $this->removeDuplicateRegistrants($query);
     return $query;
 }
Exemple #7
0
 /**
  * {@inheritdoc}
  */
 protected function buildEntityQuery($match = NULL, $match_operator = 'CONTAINS')
 {
     $query = parent::buildEntityQuery($match, $match_operator);
     $query->condition('status', FILE_STATUS_PERMANENT);
     return $query;
 }