Why do you have to enable this module twice? I cannot see the reason for having to enable the module the standard drupal method, and then enable again via the settings pages.

If you enable the module should that not be enough to enable the module completely.

Comments

ankur’s picture

Please see the comments in the .module file. The summary of it:

The node access system relies on a database table, {node_access}, to compare a user's grants against the permissions s/he's been granted within each realm in the {node_access} table. By default, there is a single entry in the table that grants 'view' access to all roles on all nodes.

This means that the entry needs to be removed when the module is enabled and re-inserted when the module is disabled. Unfortunately, the Drupal core at this time, does not include hooks that run automatically upon the enabling/disabling of a module. Ideally, the necessary changes to the database would automatically take place by placing the query in something like hook_module_enabled() and hook_module_disabled(), but these hooks are currently not a part of Druapl. In the end, I had to include a settings page explicitly requiring the user to do this by adding an additional enable/disable feature.

-Ankur