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;
    }
  }
}

Comments

jastraat’s picture

Issue summary: View changes
aleksijohansson’s picture

Created 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

aleksijohansson’s picture

Status: Active » Needs work
jastraat’s picture

@aleksijohansson - just to make sure, do you have the og_context module enabled and the comment context option checked?

jastraat’s picture