views:

212

answers:

3

I have just installed the ACL and Content Access module. Imedietly after enabling them I was asked to rebuild the permissions. All perfectly normal I am told.

However, I set the 'rebuild' permissions page running about 40 minutes ago and it still says 'Initializing'. How long should it take? Am I doing something wrong?

+1  A: 

Just refresh the page. The perms get rebuilt in a few seconds :).

mingos
Have done … a couple of times. Is there anything I can do / check?
Shaun
A little over an hour and it's sorted ;-)
Shaun
+1  A: 

The standard "rebuild perms" duration is roughly proportional to the number of node multiplied by the number of access modules enabled.

On a site with 100k nodes, you can easily take more than 24hours to rebuild permissions. Which means you simply don't want to do it interactively. But you can launch that rebuild from drush or use one of the faster non-standard rebuild methods.

FGM
How would you rebuild the permissions on a production site?
Rimian
Basically: run a CLI (drush) script which loops on module_invoke_all('node_access_records', $node) for all nodes builds a data file (non-DB) in that loop. Then, once it is complete, TRUNCATE node_access and LOAD DATA INFILE <the file> INTO node_access. And finally, tell Drupal it's done by invoking node_access_needs_rebuild(FALSE);Refine as necessary for your RAM/load limitations and the possibility of node rights changing during the rebuild loop. A mildly elaborated variant of this allowed us to drop rebuilds from 24 hours to 30 minutes.
FGM
A: 

To do it via drush, use:

drush php-eval 'node_access_rebuild();'

Pierre Nel

related questions