Essentially if a user has the group level 'approve' comment permission, they should skip comment approval when they post.
This could be accomplished by adding the following function (compatible with OG 7.x-2.x):
/**
* Implements hook_comment_presave().
*
* Auto-publish comments if user has permission to approve comments.
*/
function comment_og_comment_presave($comment) {
if (module_exists('og_context') && module_exists('comment_og')) {
global $user;
$context = og_context();
if (!empty($context)
&& (og_user_access($context['group_type'], $context['gid'], 'approve ' . $comment->node_type) || user_access('administer comments'))) {
$comment->status = COMMENT_PUBLISHED;
}
}
}
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | users_with_approval_rights_should_skip_it-2429123-2.patch | 746 bytes | aleksijohansson |
Comments
Comment #1
jastraat commentedComment #2
aleksijohansson commentedCreated a patch out of the code mentioned in the issue, but it doesn't seem to work with OG 2.x and needs more work
Comment #3
aleksijohansson commentedComment #4
jastraat commented@aleksijohansson - just to make sure, do you have the og_context module enabled and the comment context option checked?
Comment #5
jastraat commented