This module enables an alternative way of rebuilding node permissions. This is useful for websites with a very large amount of nodes.

What is different from the core way

Does not delete everything when starts from node_access table - instead it only deletes the rows that it will update so that users will still see all content while they browse the website.

Batch INSERT statements - instead of creating massive amount of INSERT queries for each node it process, the module collects the grants in batches and creates one big INSERT query that does not load the database as much. The batch limit is configurable before starting the rebuild.

Configure number of nodes to process - you can now select how many nodes you want to process for one batch operation.

New permission - since some people, who probably should not rebuild the permissions, can have access the admin pages and start the procedure, the module provides a new permission just to initiate the rebuild process.

This is a Drupal 7 only module.

project page: https://www.drupal.org/sandbox/skein/2410909

git: git clone http://git.drupal.org/sandbox/skein/2410909.git npr

Comments

skein’s picture

Title: Node Permission Rebuild Alternative » [D7] Node Permission Rebuild Alternative
PA robot’s picture

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

cfischer83’s picture

This is an excellent, well written module. I would make some suggestions in the following priority.

  1. In npr.admin.inc you have the forms api npr_permission_form() but no npr_permission_form_validate() to integer for "limit".
  2. The format of the README.txt doesn't quite match the template: https://www.drupal.org/node/2181737
  3. Although there is no issue using db_query, you might consider using db_select to obscure the database type: https://api.drupal.org/api/drupal/includes%21database%21database.inc/fun...

#3 isn't required, the README might be, and the form validation is good practice.

skein’s picture

Hi cfischer

Thanks for the review

1. Instead of a validator function I have added validators on the elements since no need to reinvent the wheel. Now only positive integers are allowed.

2. Refactored README.txt

3. Refactored queries to use db_select

Please review the changes.

Thank you.

cfischer83’s picture

Hi skein,

This looks great! Well done!

chandan chaudhary’s picture

Status: Needs review » Needs work

Hi skein,

There is a possible security threat in your module,
Look for npr.module line # 16

'access callback' => TRUE,

This will allow anonymous user to configure your module settings page.
Remove the above mention line.

klausi’s picture

Issue tags: +PAreview: security

Yep, that looks like a security issue. And please don't remove the security tag, we keep that for statistics and to show examples of security problems.

skein’s picture

Status: Needs work » Needs review

Hi Chandan

Great spot. I accidentally left it behind while in the testing stage.

It is now fixed.

kristougher’s picture

I have not done extremely thorough testing but the module seems to work and I can confirm that the issue mentioned in #6 has been fixed.

One suggestion can be to save the values entered when rebuilding.

kristougher’s picture

Status: Needs review » Reviewed & tested by the community
cweagans’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for your contribution!

I updated your account so you can promote this to a full project and also create new projects as either a sandbox or a "full" project.

Here are some recommended readings to help with excellent maintainership:

You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!

Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

Thanks to the dedicated reviewer(s) as well.

Status: Fixed » Closed (fixed)

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