Beispiel #1
0
  /**
   * {@inheritdoc}
   */
  protected function buildEntityQuery($match) {
    $query = parent::buildEntityQuery($match);

    $no_access = !$this->currentUser->hasPermission('bypass node access') && !count($this->moduleHandler->getImplementations('node_grants'));
    if ($this->configuration['include_unpublished'] !== TRUE || $no_access) {
      $query->condition('status', NODE_PUBLISHED);
    }

    return $query;
  }
Beispiel #2
0
  /**
   * {@inheritdoc}
   */
  protected function buildEntityQuery($match) {
    $query = parent::buildEntityQuery($match);

    $match = $this->database->escapeLike($match);
    // The user entity don't specify a label key so we have to do it instead.
    $query->condition('name', '%' . $match . '%', 'LIKE');

    // Filter by role.
    if (!empty($this->configuration['roles'])) {
      $query->condition('roles', $this->configuration['roles'], 'IN');
    }

    if ($this->configuration['include_blocked'] !== TRUE || !$this->currentUser->hasPermission('administer users')) {
      $query->condition('status', 1);
    }

    return $query;
  }
Beispiel #3
0
  /**
   * {@inheritdoc}
   */
  protected function buildEntityQuery($match) {
    $query = parent::buildEntityQuery($match);
    $query->condition('status', FILE_STATUS_PERMANENT);

    return $query;
  }