Split off from: http://drupal.org/node/75395
Kjartan said:
However, going back to the original patches and not the latest fix which should go in. Does the node access menu item really have to be a menu item? The way it is coded now this query will be run on pretty much every page hit. Wouldn't it better to move it out of the menu and instead have it be an additional option on the node settings page? This doesn't strike me as a feature that needs its own menu item as you should only have to run it if something has really gone wrong. Burry it somewhere with lots of warning text to never ever run this unless you have good reason to. This way it a) doesn't have a performance hit unless the user is on a specific page (menu is slow enough as it is), b) users might not get in trouble by playing around with menu items.
Also I wonder if this needs to work like search-index and be able to run in mutiple cron runs. Anyone got any data on how many nodes/node_access modules you can have before a rebuilding of the node_access table can't happen in one run?
The other thing is that in general the node access stuff can very easilly get you in all sorts of trouble, all you need is one poorly coded module that does the wrong thing. To combat this there needs to be more documentation, both for developers so they what the Right Way is, and for end users so when they download a node_access enabled module they some documentation to get them out of trouble.
Comments
Comment #1
merlinofchaos commentedI completely agree this query should not be run on very page hit, that is wasteful.
The only suggestion I can think of is to maybe come up with a site troubleshooting section, or simply stick it in the node settings page. One or the other.
Moshe?
Comment #2
magico commented@merlin: can you develop further your idea? Thanks
Probably this will be a job for 6.x-dev....
Comment #3
mdupontSeems fixed for a long time, since we have a "Rebuild permissions" link since D6.