Closed (fixed)
Project:
node privacy byrole
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
21 Apr 2006 at 07:47 UTC
Updated:
11 Jun 2007 at 08:21 UTC
Hello,
I love this tool but maybe you could make it it saves default to view by all and then deselect the people instead of not enabling any by default?
Second, when one of my admins enables an option, it wont save the new permissions while if I do it it will.
Comments
Comment #1
degerrit commentedFirst off, I'm not a NPBR developer...
As for your first problem, normally these permissions should be configured in the http://{site}/admin/settings/content-types/ screen for the content type you need.
However, this seems not to have any effect in 4.7 - on my site users can create nodes which are only editable/viewable by themselves.
Developers:
Here's what I get for a new node:
mysql> select * from node_access where nid=21039;
+-------+-----+--------------------------+------------+--------------+--------------+
| nid | gid | realm | grant_view | grant_update | grant_delete |
+-------+-----+--------------------------+------------+--------------+--------------+
| 21039 | 1 | node_privacy_byrole_role | 0 | 0 | 0 |
| 21039 | 1 | node_privacy_byrole_user | 1 | 0 | 0 |
| 21039 | 2 | node_privacy_byrole_role | 0 | 0 | 0 |
| 21039 | 3 | node_privacy_byrole_role | 0 | 0 | 0 |
| 21039 | 4 | node_privacy_byrole_role | 0 | 0 | 0 |
| 21039 | 5 | node_privacy_byrole_role | 0 | 0 | 0 |
| 21039 | 6 | node_privacy_byrole_role | 0 | 0 | 0 |
+-------+-----+--------------------------+------------+--------------+--------------+
whereas I configured things so authorized users should be able to view as well:
| 21039 | 2 | node_privacy_byrole_role | 1 | 0 | 0 |
A bug in _node_privacy_byrole_set_defaults() ?
Comment #2
degerrit commentedI did some poking around and printing out variables, especially $node->node_privacy_byrole_forview_2 which in my case is the problematic one which is never saved.
I see the problem occuring in node_privacy_byrole_nodeapi() - the default node permissions are set correctly earlier on (in case 'validate' for example) but at this point they are lost again:
case 'insert':
if ($user_has_meta_perm) {
node_privacy_byrole_save_permissions($node);
}
Why does $node->node_privacy_byrole_forview_2 (and all the other set permissions) disappear at (or before) this point?
Puzzled.
Comment #3
degerrit commentedI'm calling it a day....
I don't know if this is the proper solution but this change seems to work for me (I don't understand why it is needed though):
Strangely, 'update' does not need this fix.
Comment #4
jondoesdrupal commentedTidying up old issues. Focus now is on Drupal 5 version of the module. If there is still demand for this to be resolved and it gets resumbitted then I'll look into finding a solution. I believe this 5.x rewrite should have addressed this though.