value_form_type = 'checkbox'; } function can_expose() { return FALSE; } function get_value_options() { $this->value_options = array( 'view' => 'View', 'update' => 'Edit', 'delete' => 'Delete', ); } /** * See _node_access_where_sql() for a non-views query based implementation. */ function query() { if (!user_access('administer nodes')) { $table = $this->ensure_my_table(); $grants = array(); foreach($this->value as $access) { foreach (node_access_grants($access) as $realm => $gids) { foreach ($gids as $gid) { $grants[] = "($table.gid = $gid AND $table.realm = '$realm')"; } } } $grants_sql = ''; if (count($grants)) { $grants_sql = implode(' OR ', $grants); } $this->query->add_where('AND', $grants_sql); $grants = array(); foreach($this->value as $access) $grants[] = "$table.grant_$access >= 1"; $grants_sql = ''; if(count($grants)) { $op = strtoupper($this->operator); if ($op == 'NOT') $op = 'AND NOT'; $grants_sql = implode(" $op ", $grants); } $this->query->add_where('AND', $grants_sql); $this->query->add_groupby('nid'); } } }