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

Comments

postcarbonjason’s picture

StatusFileSize
new3 KB

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.

federico’s picture

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.

ball.in.th’s picture

Hi,

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

federico’s picture

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

andrewsuth’s picture

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

pwolanin’s picture

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.

pwolanin’s picture

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.

roderik’s picture

StatusFileSize
new1.75 KB

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.

andrewsuth’s picture

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

andrewsuth’s picture

Status: Needs work » Needs review
StatusFileSize
new1.82 KB

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.

pwolanin’s picture

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');
roderik’s picture

Status: Needs work » Needs review
StatusFileSize
new1.77 KB
new1.76 KB

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

johngriffin’s picture

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

pwolanin’s picture

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

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

pwolanin’s picture

Version: 5.x-2.4 » 6.x-1.x-dev
Status: Needs review » Fixed

committed the patches in #12

pwolanin’s picture

StatusFileSize
new1.89 KB

I think the permission name should be more verbose. Committing this change too.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.