Closed (fixed)
Project:
Nodeperm_role
Version:
master
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Anonymous (not verified)
Created:
1 Apr 2005 at 18:49 UTC
Updated:
8 Jun 2006 at 22:06 UTC
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
Comment #1
robb commentedJust a note that the patch at http://drupal.org/node/40215 also includes this modification.
Comment #2
robb commentedPatch integrated