Closed (fixed)
Project:
node privacy byrole
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
22 Jun 2007 at 19:55 UTC
Updated:
10 Jul 2008 at 20:47 UTC
This patch adds support for hook_node_operations to allow permissions to be set in bulk on the admin/content/node page like other operations such as promote, sticky, etc.
Note that the patch also removes the close php tag ?> which is not needed for module code and actually not recommended.
| Comment | File | Size | Author |
|---|---|---|---|
| node_operations.patch | 2.54 KB | dldege |
Comments
Comment #1
deekayen commentedThis will go in Drupal 6 and I'd appreciate it if you'd re-roll it for that. Actually, it's been the only thing hanging me up from committing the Drupal 6 changes.
In particular, the global for
$form_valuesisn't valid anymore and I don't think there ever was a valid check againstuser_access('administer content'), so I'm assuming that's some custom setting on your site.Comment #2
deekayen commentedNevermind, I've already started doing it.
Comment #3
deekayen commentedAlright, I'm giving up again. My changes to the source don't work - I get this error
In this code, the arguments are incomplete, but I also think the way you had it before doesn't look "proper" with the hijacking of a global to set a callback. The
exit()in here doesn't ever get called to spit out the value of$GLOBALS, so the way I'm doing this callback isn't correct either since the callback isn't ever called.I think the easiest way to get this implemented is to ditch the menu labels that separate each role out to separate sections of permissions, but I like the thinking there so I want to make that feature work.
Comment #4
deekayen commentedComment #5
deekayen commentedI committed the original patch.
Comment #6
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #7
deekayen commentedIt turns out this patch only sort of worked. Fixes are in CVS revisions 1.28.2.12 and 1.32.2.6. I wasn't able to figure out how to salvage the optgroup nesting in 6.x, so it is kind of ugly now.
Comment #8
deekayen commentedFor future reference, hook_node_access_grants() also needed to be called in addition to the update to the node_privacy_byrole table. While node_privacy_byrole table stores what should be checked off in the checkbox, node_access still needs to be told what to set for other permissions checks, and hook_node_access_grants() is the way contrib modules do that.
The only instance where I saw that hook was invoked was during node_save(). Since node_save() also activates hook_nodeapi() update, it was actually much simpler to just node_load(), mod the one object value and node_save().