Index: modules/comment/comment.module
===================================================================
--- modules/comment/comment.module	(revision 570)
+++ modules/comment/comment.module	(working copy)
@@ -147,7 +147,7 @@
   $items = array();
 
   if ($may_cache) {
-    $access = user_access('administer comments');
+    $access = user_access('administer comments') || user_access('administer comments in own node');
     $items[] = array(
       'path' => 'admin/content/comment',
       'title' => t('Comments'),
@@ -212,7 +212,7 @@
  * Implementation of hook_perm().
  */
 function comment_perm() {
-  return array('access comments', 'post comments', 'administer comments', 'post comments without approval');
+  return array('access comments', 'post comments', 'administer comments', 'post comments without approval', 'administer comments in own node');
 }
 
 /**
@@ -575,8 +575,11 @@
   global $user;
 
   if ($op == 'edit') {
-    return ($user->uid && $user->uid == $comment->uid && comment_num_replies($comment->cid) == 0) || user_access('administer comments');
+    return ($user->uid && $user->uid == $comment->uid && comment_num_replies($comment->cid) == 0) || (user_access('administer comments in own node') && user_owns_node($comment->nid)) || user_access('administer comments');
   }
+  if ($op == 'delete') {
+    return (user_access('administer comments in own node') && user_owns_node($comment->nid)) || user_access('administer comments');
+  }
 }
 
 function comment_node_url() {
@@ -818,7 +821,7 @@
 }
 
 function comment_links($comment, $return = 1) {
-  global $user;
+  global $user, $user_owns_node;
 
   $links = array();
 
@@ -832,7 +835,7 @@
   }
 
   if (node_comment_mode($comment->nid) == COMMENT_NODE_READ_WRITE) {
-    if (user_access('administer comments') && user_access('post comments')) {
+   if ((user_access('administer comments') && user_access('post comments')) || (user_access('administer comments in own node') && user_owns_node($comment->nid))) {
       $links['comment_delete'] = array(
         'title' => t('delete'),
         'href' => "comment/delete/$comment->cid"
@@ -1090,7 +1093,10 @@
 
     drupal_goto("node/$comment->nid");
   }
-  else if (is_object($comment) && is_numeric($comment->cid)) {
+  else if (!comment_access('delete', $comment)) {
+		drupal_access_denied();
+	}
+	elseif (is_object($comment) && is_numeric($comment->cid)) {
     $output = drupal_get_form('comment_confirm_delete', $comment->subject, $comment->nid);
   }
   else {
@@ -2008,3 +2014,14 @@
   return base_convert(substr($c, 1), 36, 10);
 }
 
+/*
+ * Returns true if current user created node $nid, false if not
+ */
+function user_owns_node($nid) {
+  static $cacheq;
+  global $user;
+  if (!isset($cacheq[$nid])) {
+    $cacheq[$nid] = db_result(db_query("SELECT COUNT(nid) FROM {node} WHERE nid = %d AND uid= %d", $nid, $user->uid), 0);
+  }
+  return $cacheq[$nid];
+}
\ No newline at end of file
