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 :)

AttachmentSize
modr8-bypass.patch2.25 KB

#1

postcarbonjason - October 23, 2008 - 23:43

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.

AttachmentSize
modr8-bypass2.patch 3 KB

#2

federico - December 23, 2008 - 20:08

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

ball.in.th - January 5, 2009 - 17:42

Hi,

I would like to see this feature for Drupal 6.x as well.

#4

federico - February 24, 2009 - 14:52
Status:needs review» reviewed & tested by the community

I've tested this patch on a production site for two month and It works OK for me

#5

andrewsuth - March 31, 2009 - 01:46

@ball.in.th
This should do the trick: http://drupal.org/node/418896

#6

pwolanin - April 4, 2009 - 15:53
Status:reviewed & tested by the community» needs work

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

pwolanin - April 4, 2009 - 15:57

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

roderik - May 9, 2009 - 19:39

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.

AttachmentSize
bypass_moderation-5.x-2.5.patch 1.75 KB

#9

andrewsuth - June 5, 2009 - 14:36

+1 to have the patch from #8 added to modr8 for D5 and D6.

#10

andrewsuth - June 5, 2009 - 15:44
Status:needs work» needs review

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.

AttachmentSize
modr8.module.patch 1.82 KB

#11

pwolanin - June 8, 2009 - 01:53
Status:needs review» needs work

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

roderik - July 4, 2009 - 22:48
Status:needs work» needs review

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

AttachmentSize
bypass_moderation_-5.x-2.5.patch 1.76 KB
bypass_moderation_-6.x-1.1.patch 1.77 KB

#13

johngriffin - August 29, 2009 - 10:56

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

pwolanin - November 9, 2009 - 04:32

@roderik - most of that ugly code I inherited from the prior maintainer.

I assume this patch would not interfere with the add-on module?

 
 

Drupal is a registered trademark of Dries Buytaert.