When changing the view permissions on a node, they are being overwritten in part by the edit permissions. I had a node that I wanted to be editable for two roles, and visible by that same two and two other roles as well. These roles with view but no edit permission happened to be first in the selection box, so they simply got overwritten in the second 'foreach' shown below. The offending code:

(from line 309 of nodeperm_role.module):

      foreach ((array) $edit['nodeperm_role_view'] as $key => $rid) {
        $edit['nodeperm_role_view'][$key] = $rid;
      }
      foreach ((array) $edit['nodeperm_role_edit'] as $key => $rid) {
        $edit['nodeperm_role_view'][$key] = $rid;
        $edit['nodeperm_role_edit'][$key] = $rid;
      }

I changed it to the following in my copy:

      foreach ((array) $edit['nodeperm_role_view'] as $key => $rid) {
        $edit['nodeperm_role_view'][$key] = $rid;
      }
      foreach ((array) $edit['nodeperm_role_edit'] as $key => $rid) {
        $edit['nodeperm_role_edit'][$key] = $rid;
      }

It would allow a user being able to edit a node without being able to see it, though.

Comments

robb’s picture

Just a note that the patch at http://drupal.org/node/40215 also includes this modification.

robb’s picture

Assigned: Unassigned » robb
Status: Active » Closed (fixed)

Patch integrated