array( 'title' => t('Can access'), 'short' => t('access'), 'method' => 'op_simple', 'values' => 1, ), ); } function get_value_options() { $this->value_options = array( 'grant_view' => 'View', 'grant_update' => 'Edit', 'grant_delete' => 'Delete', ); } /** * See _node_access_where_sql() for a non-views query based implementation. */ function query() { if(empty($this->value)) return; if (TRUE) { //(!user_access('administer nodes')) { $table = $this->ensure_my_table(); $grants = array(); foreach (node_access_grants('view') 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); foreach($this->value as $value) { $this->query->add_where('AND', "$table.$value >= 1"); } } } }