Index: commentrss.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/commentrss/commentrss.module,v
retrieving revision 1.12.2.2.4.4
diff -u -p -r1.12.2.2.4.4 commentrss.module
--- commentrss.module	8 May 2008 10:28:01 -0000	1.12.2.2.4.4
+++ commentrss.module	6 Oct 2008 10:27:07 -0000
@@ -97,51 +97,54 @@ function commentrss_menu($may_cache) {
         'type' => MENU_CALLBACK
       );
     }
-
-    // Expose site feed based on settings.
-    switch (variable_get('commentrss_site', COMMENTRSS_SITE_FRONT_PAGE)) {
-      case COMMENTRSS_SITE_DISABLED:
-        // No comment RSS feed for site.
-        break;
-      case COMMENTRSS_SITE_FRONT_PAGE:
-        if (!drupal_is_front_page()) {
-          // Only break if not front page.
+    
+    // If user could access these feeds.
+    if (user_access('access comments')) {
+      // Expose site feed based on settings.
+      switch (variable_get('commentrss_site', COMMENTRSS_SITE_FRONT_PAGE)) {
+        case COMMENTRSS_SITE_DISABLED:
+          // No comment RSS feed for site.
           break;
-        }
-      case COMMENTRSS_SITE_FRONT_AND_NODE_PAGE:
-        if (!drupal_is_front_page() || ($_GET['q'] != 'node')) {
-          // Only break if not front page and not node page.
+        case COMMENTRSS_SITE_FRONT_PAGE:
+          if (!drupal_is_front_page()) {
+            // Only break if not front page.
+            break;
+          }
+        case COMMENTRSS_SITE_FRONT_AND_NODE_PAGE:
+          if (!drupal_is_front_page() || ($_GET['q'] != 'node')) {
+            // Only break if not front page and not node page.
+            break;
+          }
+        case COMMENTRSS_SITE_ALL_PAGES:
+          // Either we need to expose for all pages, or code was falling through
+          // to this point. We should expose the feed in any case.
+          drupal_add_feed(
+            url('crss'),
+            t('@site - All comments', array('@site' => variable_get('site_name', 'Drupal')))
+          );
           break;
-        }
-      case COMMENTRSS_SITE_ALL_PAGES:
-        // Either we need to expose for all pages, or code was falling through
-        // to this point. We should expose the feed in any case.
+      }
+  
+      // Expose node feed on node view page.
+      if ((arg(0) == 'node') && is_numeric($nid = arg(1)) && is_null(arg(2)) &&
+          variable_get('commentrss_node', TRUE) && ($node = node_load($nid)) &&
+          ($node->comment != COMMENT_NODE_DISABLED)) {
+          
         drupal_add_feed(
-          url('crss'),
-          t('@site - All comments', array('@site' => variable_get('site_name', 'Drupal')))
+          url('crss/node/'. $node->nid),
+          t('Comments for "@title"', array('@title' => $node->title))
         );
-        break;
-    }
-
-    // Expose node feed on node view page.
-    if ((arg(0) == 'node') && is_numeric($nid = arg(1)) && is_null(arg(2)) &&
-        variable_get('commentrss_node', TRUE) && ($node = node_load($nid)) &&
-        ($node->comment != COMMENT_NODE_DISABLED)) {
-        
-      drupal_add_feed(
-        url('crss/node/'. $node->nid),
-        t('Comments for "@title"', array('@title' => $node->title))
-      );
-    }
-    
-    // Expose term feed on term view page.
-    if ((arg(0) == 'taxonomy') && (arg(1) == 'term') && is_numeric($tid = arg(2)) &&
-        variable_get('commentrss_term', FALSE) && ($term = taxonomy_get_term($tid))) {
- 
-      drupal_add_feed(
-        url('crss/term/'. $term->tid),
-        t('Comments for category "@title"', array('@title' => $term->name))
-      );
+      }
+      
+      // Expose term feed on term view page.
+      if ((arg(0) == 'taxonomy') && (arg(1) == 'term') && is_numeric($tid = arg(2)) &&
+          variable_get('commentrss_term', FALSE) && ($term = taxonomy_get_term($tid))) {
+   
+        drupal_add_feed(
+          url('crss/term/'. $term->tid),
+          t('Comments for category "@title"', array('@title' => $term->name))
+        );
+      }
     }
     
   }
