Index: modules/forum/forum.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/forum/forum.module,v
retrieving revision 1.448.2.8
diff -u -p -r1.448.2.8 forum.module
--- modules/forum/forum.module	1 Mar 2010 11:32:00 -0000	1.448.2.8
+++ modules/forum/forum.module	10 Aug 2010 06:06:44 -0000
@@ -85,7 +85,7 @@ function forum_menu() {
   $items['forum'] = array(
     'title' => 'Forums',
     'page callback' => 'forum_page',
-    'access arguments' => array('access content'),
+    'access arguments' => array('access forum'),
     'type' => MENU_SUGGESTED_ITEM,
     'file' => 'forum.pages.inc',
   );
@@ -325,7 +325,7 @@ function forum_access($op, $node, $accou
  * Implementation of hook_perm().
  */
 function forum_perm() {
-  return array('create forum topics', 'delete own forum topics', 'delete any forum topic', 'edit own forum topics', 'edit any forum topic', 'administer forums');
+  return array('access forum', 'create forum topics', 'delete own forum topics', 'delete any forum topic', 'edit own forum topics', 'edit any forum topic', 'administer forums');
 }
 
 /**
@@ -419,7 +419,7 @@ function forum_block($op = 'list', $delt
       break;
 
     case 'view':
-      if (user_access('access content')) {
+      if (user_access('access forum')) {
         switch ($delta) {
           case 0:
             $title = t('Active forum topics');
@@ -661,70 +661,73 @@ function template_preprocess_forums(&$va
   }
   drupal_set_breadcrumb($breadcrumb);
   drupal_set_title(check_plain($title));
-
-  if ($variables['forums_defined'] = count($variables['forums']) || count($variables['parents'])) {
-    // Format the "post new content" links listing.
-    $forum_types = array();
-
-    // Loop through all node types for forum vocabulary.
-    foreach ($vocabulary->nodes as $type) {
-      // Check if the current user has the 'create' permission for this node type.
-      if (node_access('create', $type)) {
-        // Fetch the "General" name of the content type;
-        // Push the link with title and url to the array.
-        $forum_types[$type] = array('title' => t('Post new @node_type', array('@node_type' => node_get_types('name', $type))), 'href' => 'node/add/'. str_replace('_', '-', $type) .'/'. $variables['tid']);
+  if (user_access('access forum')) {
+    if ($variables['forums_defined'] = count($variables['forums']) || count($variables['parents'])) {
+      // Format the "post new content" links listing.
+      $forum_types = array();
+  
+      // Loop through all node types for forum vocabulary.
+      foreach ($vocabulary->nodes as $type) {
+        // Check if the current user has the 'create' permission for this node type.
+        if (node_access('create', $type)) {
+          // Fetch the "General" name of the content type;
+          // Push the link with title and url to the array.
+          $forum_types[$type] = array('title' => t('Post new @node_type', array('@node_type' => node_get_types('name', $type))), 'href' => 'node/add/'. str_replace('_', '-', $type) .'/'. $variables['tid']);
+        }
+      }
+  
+      if (empty($forum_types)) {
+        // The user is logged-in; but denied access to create any new forum content type.
+        if ($user->uid) {
+          $forum_types['disallowed'] = array('title' => t('You are not allowed to post new content in the forum.'));
+        }
+        // The user is not logged-in; and denied access to create any new forum content type.
+        else {
+          $forum_types['login'] = array('title' => t('<a href="@login">Login</a> to post new content in the forum.', array('@login' => url('user/login', array('query' => drupal_get_destination())))), 'html' => TRUE);
+        }
       }
-    }
-
-    if (empty($forum_types)) {
-      // The user is logged-in; but denied access to create any new forum content type.
-      if ($user->uid) {
-        $forum_types['disallowed'] = array('title' => t('You are not allowed to post new content in the forum.'));
+      $variables['links'] = $forum_types;
+  
+      if (!empty($variables['forums'])) {
+        $variables['forums'] = theme('forum_list', $variables['forums'], $variables['parents'], $variables['tid']);
       }
-      // The user is not logged-in; and denied access to create any new forum content type.
       else {
-        $forum_types['login'] = array('title' => t('<a href="@login">Login</a> to post new content in the forum.', array('@login' => url('user/login', array('query' => drupal_get_destination())))), 'html' => TRUE);
+        $variables['forums'] = '';
       }
-    }
-    $variables['links'] = $forum_types;
-
-    if (!empty($variables['forums'])) {
-      $variables['forums'] = theme('forum_list', $variables['forums'], $variables['parents'], $variables['tid']);
-    }
-    else {
-      $variables['forums'] = '';
-    }
-
-    if ($variables['tid'] && !in_array($variables['tid'], variable_get('forum_containers', array()))) {
-      $variables['topics'] = theme('forum_topic_list', $variables['tid'], $variables['topics'], $variables['sortby'], $variables['forum_per_page']);
-      drupal_add_feed(url('taxonomy/term/'. $variables['tid'] .'/0/feed'), 'RSS - '. $title);
-    }
-    else {
-      $variables['topics'] = '';
-    }
-
-    // Provide separate template suggestions based on what's being output. Topic id is also accounted for.
-    // Check both variables to be safe then the inverse. Forums with topic ID's take precedence.
-    if ($variables['forums'] && !$variables['topics']) {
-      $variables['template_files'][] = 'forums-containers';
-      $variables['template_files'][] = 'forums-'. $variables['tid'];
-      $variables['template_files'][] = 'forums-containers-'. $variables['tid'];
-    }
-    elseif (!$variables['forums'] && $variables['topics']) {
-      $variables['template_files'][] = 'forums-topics';
-      $variables['template_files'][] = 'forums-'. $variables['tid'];
-      $variables['template_files'][] = 'forums-topics-'. $variables['tid'];
+  
+      if ($variables['tid'] && !in_array($variables['tid'], variable_get('forum_containers', array()))) {
+        $variables['topics'] = theme('forum_topic_list', $variables['tid'], $variables['topics'], $variables['sortby'], $variables['forum_per_page']);
+        drupal_add_feed(url('taxonomy/term/'. $variables['tid'] .'/0/feed'), 'RSS - '. $title);
+      }
+      else {
+        $variables['topics'] = '';
+      }
+  
+      // Provide separate template suggestions based on what's being output. Topic id is also accounted for.
+      // Check both variables to be safe then the inverse. Forums with topic ID's take precedence.
+      if ($variables['forums'] && !$variables['topics']) {
+        $variables['template_files'][] = 'forums-containers';
+        $variables['template_files'][] = 'forums-'. $variables['tid'];
+        $variables['template_files'][] = 'forums-containers-'. $variables['tid'];
+      }
+      elseif (!$variables['forums'] && $variables['topics']) {
+        $variables['template_files'][] = 'forums-topics';
+        $variables['template_files'][] = 'forums-'. $variables['tid'];
+        $variables['template_files'][] = 'forums-topics-'. $variables['tid'];
+      }
+      else {
+        $variables['template_files'][] = 'forums-'. $variables['tid'];
+      }
+  
     }
     else {
-      $variables['template_files'][] = 'forums-'. $variables['tid'];
+        drupal_set_title(t('No forums defined'));
+        $variables['links'] = array();
+        $variables['forums'] = '';
+        $variables['topics'] = '';
     }
-
-  }
-  else {
-    drupal_set_title(t('No forums defined'));
-    $variables['links'] = array();
-    $variables['forums'] = '';
-    $variables['topics'] = '';
+  } else {
+    drupal_access_denied();
   }
 }
 
