Hi

I have installed TAC but I have a very bad problem.

I have created a vocabulary and a role for my user. When I create a new page I affect a term of my vocabulary to this page but
all my users can access to this page. I watch in my node_access table in my database and I see that two lines are created: 3
| 3 | 0 | all | 1 | 0 | 0 |
| 3 | 1 | term_access | 1 | 0 | 0 |

when I delete the first line manually, the none access is good, but It's a very big problem to me, I don't want to have to delete manually this line every time. TAC is supposed to do that but it's not that in reality.

I need help please.

Thanks.

NB: I have installed Drupal 5.7

Comments

antoineG-1’s picture

I do that to answer my question in my node.module file. I'm not sure that's a good solution but it's work.

function node_access_write_grants($node, $grants, $realm = NULL, $delete = TRUE) {
$delete = TRUE;
if ($delete) {
$query = 'DELETE FROM {node_access} WHERE nid = %d';
if ($realm) {
$query .= " AND realm in ('%s', 'all')";
}
db_query($query, $node->nid, $realm);
}

// Only perform work when node_access modules are active.
if (count(module_implements('node_grants'))) {
foreach ($grants as $grant) {
if ($realm && $realm != $grant['realm']) {
continue;
}
// Only write grants; denies are implicit.
if ($grant['grant_view'] || $grant['grant_update'] || $grant['grant_delete']) {
if ((count($grants)<=4) && ($grant['realm']!='all')){
db_query("INSERT INTO {node_access} (nid, realm, gid, grant_view, grant_update, grant_delete) VALUES (%d, '%s', %d, %d, %d,%d)",$node->nid,
$grant['realm'], $grant['gid'], $grant['grant_view'], $grant['grant_update'], $grant['grant_delete']);
}

if ((count($grants)==5) && ($grant['realm']=='all')){
db_query("INSERT INTO {node_access} (nid, realm, gid, grant_view, grant_update, grant_delete) VALUES (%d, '%s', %d, %d, %d,
%d)",$node->nid, $grant['realm'], $grant['gid'], $grant['grant_view'], $grant['grant_update'], $grant['grant_delete']);
}
}
}
}
}

If somenone can explain me....

Thanks.

xjm’s picture

There are three things to do in this situation:

  1. Make sure the authenticated user role does not have the permission you're trying to deny.
  2. Rebuild the node access table at admin/content/node-settings/rebuild.
  3. Follow the other troubleshooting in the README.
xjm’s picture

Status: Active » Closed (fixed)