00001 <?php 00007 class views_handler_filter_node_access extends views_handler_filter { 00008 function admin_summary() { } 00009 function operator_form(&$form, &$form_state) { } 00010 function can_expose() { 00011 return FALSE; 00012 } 00013 00017 function query() { 00018 if (!user_access('administer nodes')) { 00019 $table = $this->ensure_my_table(); 00020 $grants = db_or(); 00021 foreach (node_access_grants('view') as $realm => $gids) { 00022 foreach ($gids as $gid) { 00023 $grants->condition(db_and() 00024 ->condition($table . '.gid', $gid) 00025 ->condition($table . '.realm', $realm) 00026 ); 00027 } 00028 } 00029 00030 $this->query->add_where('AND', $grants); 00031 $this->query->add_where('AND', $table . '.grant_view', 1, '>='); 00032 } 00033 } 00034 }