I am using the Token Content Access module to hide member created nodes from public view and but allow them to share private links with private links (URL tokens). My problem is I would like towhen a user restricts access thoseto individual nodes through viewsusing URL tokens, someone did a brilliant patch on tca_views_query_alter()
buthe cannot access them without the node is viewable only for admin users, not for all authenticated users. Any suggestions on how to make it work?token either!
function tca_views_query_alter(&$view, &$query) {
// Alter all node queries to remove TCA protected nodes if user does not have
// bypass access.
if($view->name != "view_name_here" && $view->name != 'another_view_name_here_if_needed'){
if ($query->base_table == 'node' && !user_access('bypass tca_node')) {
$query->add_field('node', 'tca_active', 'tca_active');
$query->add_where_expression(0, "node.tca_active = '0' OR node.tca_active IS NULL");
}
}
}