Closed (fixed)
Project:
node privacy byrole
Version:
4.5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
12 May 2005 at 15:34 UTC
Updated:
16 May 2005 at 21:49 UTC
I am using ver 4.5.2 and have developed http://wildernesslt.org for a friend. I added a "manager" role to give some limited oversight and document editing to designated managers. I found that users with the manager role could edit nodes with the "Filtered HTML" Input Format however the edit tab is not available to the manager for nodes that are set to "Full HTML" and "PHP Code" Input Format.
Thanks in advance!
Comments
Comment #1
ankur commentedHey Josh,
I did some testing and was able to reproduce the problem. I was also able to find the only, less-than-optimal fix to the problem as well:
Your manager role needs to have the 'administer filters' permissions as well in the access control.
The problem is that anyone who wants to edit a node with a restricted filter format (where "restricted filter format" == Full HTML and PHP code) has to be explicitly given the 'administer filters' permission whether node_privacy_byrole is turned on or not. This is because the function node_access() checks to see if the user has the permission to prevent unauthorized people from posting their own HTML of PHP on the site.
Typically, node_access() will call hook_access(). If hook_access() says yes, then the user gets permission. If hook_access() says no, then the user doesn't have access, if hook_access() does not return a TRUE or FALSE, then function node_access() uses DB table {node_access} to answer the permission question for a node. Now, THE CATCH, is that before function node_access() does any of these, it calls a function filter_access() in the event that the node in question uses a restricted filter format. The only interaction NPBR has with this scheme is that it inserts and deletes permissions info from the {node_access} table, which means it has nothing to do with the check for the "administer filters"
So, SHORT TERM SOLUTION: Give the manager role the 'administer filters' permission.
LONG TERM: Try to get a patch into Drupal core that allows you to configure which permissions have rights to use which filters... or at least patch it so that another node can override it, similar to the way another module can override node view/edit perms... :)
Nice work on the MfA site, by the way.
-Ankur
Comment #2
jkoenig commentedThat config change worked. Thanks much for your help.
Comment #3
ankur commented