Project

General

Profile

Paste
Download (794 Bytes) Statistics
| Branch: | Revision:

root / drupal7 / sites / all / modules / views / modules / node / views_handler_filter_node_access.inc @ d719f12f

1
<?php
2

    
3
/**
4
 * @file
5
 * Definition of views_handler_filter_node_access.
6
 */
7

    
8
/**
9
 * Filter by node_access records.
10
 *
11
 * @ingroup views_filter_handlers
12
 */
13
class views_handler_filter_node_access extends views_handler_filter {
14
  function admin_summary() { }
15
  function operator_form(&$form, &$form_state) { }
16
  function can_expose() {
17
    return FALSE;
18
  }
19

    
20
  /**
21
   * See _node_access_where_sql() for a non-views query based implementation.
22
   */
23
  function query() {
24
    if (!user_access('administer nodes') && module_implements('node_grants')) {
25
      $table = $this->ensure_my_table();
26
      $grants = node_add_node_grants_to_query(node_access_grants('view'));
27

    
28
      $this->query->add_where('AND', $grants);
29
      $this->query->add_where('AND', $table . '.grant_view', 1, '>=');
30
    }
31
  }
32
}