On my site a single node suddenly showed "access denied" for guests.

We could track down the bug. In the modules configuration I did not activate the roles "guest" and "authenticated users" in the allowed roles configuration.

In this case the module did not preserve the default grants for anonymous users, we fixed the bug in the attached patch. Thanks blackice2999!

CommentFileSizeAuthor
nodeaccess-preservegrants-ignored.patch2.29 KBk4v
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Blackice2999’s picture

Status: Active » Reviewed & tested by the community

hi, i can confirm this ;)

The second condition will be never reached because the first condition fails, so we never comes to the preserve elseif.

if (isset($allowed_roles[$key]) && $allowed_roles[$key]) {
  if ($allowed_roles[$key]) {...}
  elseif($preserved) {...}
}
Blackice2999’s picture

Version: 7.x-1.0 » 7.x-1.x-dev

The Patch is agains the dev version... so change the issue version to dev.

vlad.pavlovic’s picture

Status: Reviewed & tested by the community » Fixed

Pushed to dev version. It will take some time before it is available for download. Thank you for your work on this.

Status: Fixed » Closed (fixed)

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