Overrides SelectionBase::buildEntityQuery().
Overrides SelectionBase::buildEntityQuery
public 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);
}
// Adding the 'user_access' tag is sadly insufficient for users: core
// requires us to also know about the concept of 'blocked' and 'active'.
if (!user_access('administer users')) {
$query
->condition('status', 1);
}
return $query;
}