I'm working on new set of permission to allow users manage comments on some content types.
I've also added a new access comment overview page to let user view the comments that's related to them more easily
It gives them access to admin/content/comment page

Let me know if you're interested and if something similar is already under development

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rschwab’s picture

Hi sinasalek! This sounds great, please share the code if you'd like to see this added to the module. Nothing like this is currently being developed, but it sounds like a great addition.

sinasalek’s picture

Here is the patch :)
it introduces two set of new permissions
administer comments by any content
access the comment overview page

sinasalek’s picture

It's also possible to support views as well , however i haven't come up with a generic way for this yet

/**
 * @param $view
 */
function mymodule_views_pre_execute(&$view) {
  if ($view->name == 'admin_views_comment' && !user_access("administer comments")) {
    $node_types = node_type_get_types();
    $allowed_node_types = array();
    foreach ($node_types as $node_type => $node_types_info) {
      if (user_access("administer comments on any $node_type")) {
        $allowed_node_types[] = $node_type;
      }
    }
    if ($allowed_node_types) {
      $view->build_info['query']->condition('type', array($allowed_node_types), 'IN');
    } else {
      $view->build_info['query']->condition('type', 'NOOOOOOOOOOOO');
    }
  }
}
rschwab’s picture

Title: Administer comments on any content » Administer comments by type & access comment overview permissions
Category: task » feature
Status: Active » Needs review
kristianb21’s picture

Hi, I like the feature proposed by sinasalek! Way to go.

I was looking for a way to add permissions to a "moderator" role where the user would have permissions to edit or unpublish comments and this looks like it will work

aruuska’s picture

Sorry! My mistake! Patch is exactly what I described earlier... :)
I'll test it now.

aruuska’s picture

Seems to work for me.
Only problem is that if admin/content/comments is views list (overridden with views), then comment access module weight in system table need to change higher than views module weight.

aruuska’s picture

This is a patch version that works in drush make.

aruuska’s picture

Sorry, here is the right patch.

formatC'vt’s picture

Issue summary: View changes
Status: Needs review » Needs work

patch needs a re-roll to current dev.

waako’s picture

Status: Needs work » Needs review
FileSize
7.55 KB

Rerolled patch in #9 against 7.x-1.x.
No conflicts, no file size change.

New permissions are visible and seem to work.