Allow bypass of moderation on per-role basis
postcarbonjason - October 22, 2008 - 05:57
| Project: | modr8 |
| Version: | 5.x-2.4 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Description
I had a need to bypass moderation on specific node types for specific roles, patch is attached. Hopefully this is useful to someone besides me :)
| Attachment | Size |
|---|---|
| modr8-bypass.patch | 2.25 KB |

#1
Update: cleaned up Access Control to reflect display name of content types instead of internal name. See attached for updated patch against 5.x-2.4.
#2
I was looking for this.
Applied path against 5.x-2.4, tested on localhost using different accounts and seems to work fine. Will apply on a production site for some days and see if it gives errors or works fine.
#3
Hi,
I would like to see this feature for Drupal 6.x as well.
#4
I've tested this patch on a production site for two month and It works OK for me
#5
@ball.in.th
This should do the trick: http://drupal.org/node/418896
#6
I'm not sure that providing this level of granularity is helpful - there could be dozens of content types.
I think that this implementation would also need an implementation of hook_node_type to watch for any changes to node type names.
Patch also includes code comments re: "hack" which are certainly not RTBC.
#7
see: http://drupal.org/node/418896 and http://drupal.org/node/153462
for how to implement this sort of functionality in D6 or D5 wihtout hacking the module.
#8
That solution has the drawback, that the user still gets modr8's message "your ... will be submitted for moderation' on the content entry/preview screen.
Although the referenced mini-module could be altered to work around modr8's message, it seems to me that this is better done inside the modr8 module.
Anyway, whether you agree with me or not - here's http://drupal.org/node/153462 reworked to be a modr8 patch which also suppresses the preview message.
#9
+1 to have the patch from #8 added to modr8 for D5 and D6.
#10
Patch for modr8 6.x-1.1 giving the same functionality as outlined in comment #8 with the addition of the following line:
$node->status = 1; // set the node to published.Which will also set the node to published if the user has permission to bypasses moderation.
#11
Setting to published seems a little problematic, have to think about that. Also, a minor code-style issue here:
return array('moderate content','bypass moderation');#12
About setting the node to 'published': modr8 has never(?) messed with that flag and shouldn't start doing so now. It will get confusing.
The 'normal workflow logic' (without the modr8 module) is perfectly capable of setting the 'published' property for nodes that are not moderated, and it should also be able to do so for nodes that are moderated -- at least for me it always has.
@andrewsuth: can you do what you need in the workflow settings in admin/content/node-type/WHATEVER?
I've attached patches iwth the 'status' lines removed and the minor code-style issue modified.
@pwolanin: I'm glad my code does not include string concatenators, because then I would have to diverge from your code-style. Your 6.x module is not compliant with the new 6.x code style :-p
#13
Hi, check out the module I've just released, it allows selected roles to bypass moderation. It also allows you to set whether the node should be published by default or not for bypassers, overriding the default workflow settings.
http://drupal.org/project/modr8_bypass
#14
@roderik - most of that ugly code I inherited from the prior maintainer.
I assume this patch would not interfere with the add-on module?