You are here

function comment_perm_perm in Comment Permissions 6

Same name and namespace in other branches
  1. 5 comment_perm.module \comment_perm_perm()

Implementation of hook_perm().

File

./comment_perm.module, line 31
Module to control commenting permissions by role and by node type.

Code

function comment_perm_perm() {
  $perms = array();
  $types = variable_get('comment_perm_node_types', array());
  if (is_array($types)) {
    foreach ($types as $type) {
      if ($type) {
        $perms[] = $type . ': comment on any ' . $type . ' content';
        $perms[] = $type . ': comment without approval on any ' . $type . ' content';
        $perms[] = $type . ': comment without approval on own ' . $type . ' content';
        $perms[] = $type . ': edit own comments on ' . $type . ' content';
      }
    }
  }
  return $perms;
}