Index: tac_lite.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/tac_lite/tac_lite.module,v retrieving revision 1.9.2.6 diff -u -b -r1.9.2.6 tac_lite.module --- tac_lite.module 9 Dec 2008 21:47:30 -0000 1.9.2.6 +++ tac_lite.module 1 Mar 2009 11:39:50 -0000 @@ -11,6 +11,7 @@ * Implementation of hook_help(). */ function tac_lite_help($section) { + $output = ''; switch ($section) { case 'admin/help#tac_lite': $output .= '
'.t('This module allows you to restrict access to site content. It uses a simple scheme based on Taxonomy, Users and Roles. It uses the node_access table and other features built into Drupal to hide content from unauthorized users.')."
\n"; @@ -322,6 +323,7 @@ } } + if (!count($tids)) { // no relevant terms found. @@ -331,6 +333,12 @@ // if we're here, the node has terms associated with it which restrict // access to the node. $grants = array(); + $defaults = array( + 'grant_view' => FALSE, + 'grant_update' => FALSE, + 'grant_delete' => FALSE, + 'priority' => 0, + ); for ($i = 1; $i <= variable_get('tac_lite_schemes', 1); $i++) { $config = _tac_lite_config($i); foreach ($tids as $tid) { @@ -341,6 +349,7 @@ foreach($config['perms'] as $perm) { $grant[$perm] = TRUE; } + $grant = array_merge($grant, $defaults); $grants[] = $grant; } } @@ -424,7 +433,7 @@ // add per-role grants in addition to per-user grants $defaults = variable_get('tac_lite_grants_scheme_' . $scheme, array()); foreach ($account->roles as $rid => $role_name) { - if (count($defaults[$rid])) { + if (isset($defaults[$rid]) && count($defaults[$rid])) { foreach ($defaults[$rid] as $tids) { if (count($tids)) { $grants = array_merge($grants, $tids);