To whoever uses the node_access_example.module, on the instructions at the beggining of the file it says to insert this line to the DB - INSERT INTO node_access (nid, gid, realm, grant_view, grant_update, grant_delete) VALUES (0, 0, 'example', 1, 0, 0) .
This grants permission to all users to view all nodes, which kinds of takes the edge out of the access example. This line is needed because otherwise you wouldn't be able to see nodes that were created before this module was added. But it actually prevents the access module from working.
My solution was to replace that line by INSERT INTO node_access (nid, gid, realm, grant_view, grant_update, grant_delete) VALUES (0, 1, 'example', 1, 0, 0) . Which actually means that only users with access right to private content can see all the nodes in the system. This makes older nodes hidden to all users that don't have the new privilige.

I wonder if this means that access modules are not plugable like any other module, and has to be installed at the beggining of the use of drupal. A possible solution to that is to add another hook to the access interface that should be invoked in case no access information was found in the DB, this way an access implementing module can decide what to do with data was created before the module was added.

Dror.

Comments

matteo’s picture

Thanks for the suggestion, I was going crazy with that module.....
However, I can't undestand what is the meaning oif node_access table columns...
Can you help me , or suggest to me where it is explained ??

thanks a lot
Matteo

cosmicdreams’s picture

Project: » Drupal core
Version: » 6.x-dev
Component: other » node.module

Is this a drupal core issue? I'm look for the right module. Sounds like bug and bugs don't go here. Sorry for putting it on 6.x didn't know where else to put it.

jp.stacey’s picture

Version: 6.x-dev » 4.7.9

The node_access_example.module is a developer sample module on the API site: http://api.drupal.org/api/file/developer/examples/node_access_example.mo...

However, the original SQL that Dru reports as being "at the beginning of the file" is only in the D4 example: http://api.drupal.org/api/file/developer/examples/node_access_example.mo...

I reckon this bug report should be closed unless the D5 and D6 versions of the example code specifically don't address the original issue.

pasqualle’s picture

Status: Active » Closed (won't fix)

This version is not supported. Reopen or create a new issue if the problem exists in any recent version (version equal or above Drupal 5)