I'm evaluating the use of this module on a site with tens of thousands of users and nodes. From this section of code in nodeaccess_password_user():

  elseif ($op == "after_update" || $op == "insert") {
    node_access_rebuild();
  }

it looks like the entire node access table is rebuild on creation or update of a user. Is this intentional, and if so, is there a way to do it wiithout rebuilding the whole thing (which will timeout on sites with a lot of content)?

Comments

danielb’s picture

I guess it is intentional in the fact that the nodes need to be rebuilt and checked for the password. Drupal 6 does discourage using this function though for exactly the reasons you said.

It is possible to change it to node_access_needs_rebuild(), which is the preferred way of rebuilding in drupal 6 (it deosn't time out) but the massive flaw in that is that it isn't automatic, and requires an admin to come to the site and do the rebuild manually.

Otherwise you'd have to rebuild nodes individually somehow, by choosing them a smarter way. Perhaps adding them to a queue and going through a handful of them on each page load, or cron, or something.

If you have your head in this at the moment, perhaps you could figure out a way?

danielb’s picture

Status: Active » Fixed

I have create a 3.x branch which will appear soon. It doesn't rebuild the entire node access table, but uses this module to silently update the nodes it needs: http://drupal.org/project/node_access_rebuild_bonus
untested for now

danielb’s picture

Status: Fixed » Active

Actually .. come to think of it .. I don't think there is any reason to update any nodes upon updating/inserting a user... the nodes are already updated by the node module when any operation is performed on them... hmm....

danielb’s picture

Status: Active » Fixed

ok I've removed rebuilding altogether for the 3.x branch.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.