First of all, I want to apologise if this is not the place where I should put this issue or if it was already been made. I tried to use the search mechanisms but they're not working today and I also couldn't find anything similar just looking around.
I have Drupal 4.5.0 installed at home and I wanted to make some access restrictions. What I wanted exactly: I wanted that people who are not logged cannot see the Polls and the Forums, but they can see other content. Both modules check if the user has "access content" permission. But it was not enough for me, because I want everybody to have access to the other content. So, here I'll describe how I solved it and if you like you can make something similar (or tell me another easier way to do it).
1) The first thing to do was to modify the node.module, in the function node_view. I added this check in the beggining of the function. This calls the 'access' hook in the module, with the $op 'display' and only displays the node if it returns TRUE (or if doens't return --> return null):
$access = module_invoke(node_get_module_name($node), 'access', 'display', $node);
if (!is_null($access) && ! $access) {
return;
}
2) Then I had to change each module. Here I'll show what how I changed the pool.module.
a) Create a new permission, that the administrator can use to give display access to roles/users