diff --git a/core/modules/forum/forum.module b/core/modules/forum/forum.module
index f557c40..e5d0e7a 100644
--- a/core/modules/forum/forum.module
+++ b/core/modules/forum/forum.module
@@ -198,15 +198,19 @@ function forum_menu_local_tasks_alter(&$data, $router_item, $root_path) {
         }
         // Anonymous user does not have access to create new topics.
         else {
-          $links['login'] = array(
-            '#theme' => 'menu_local_action',
-            '#link' => array(
-              'title' => t('<a href="@login">Log in</a> to post new content in the forum.', array(
-                '@login' => url('user/login', array('query' => drupal_get_destination())),
-              )),
-              'localized_options' => array('html' => TRUE),
-            ),
-          );
+          // If authenticated users can post new topic, provide a login link.
+          $authenticated_perms = user_role_permissions(array(DRUPAL_AUTHENTICATED_RID => 'authenticated user'));
+          if (array_key_exists('create forum content', $authenticated_perms[DRUPAL_AUTHENTICATED_RID])) {
+            $links['login'] = array(
+              '#theme' => 'menu_local_action',
+              '#link' => array(
+                'title' => t('<a href="@login">Log in</a> to post new content in the forum.', array(
+                  '@login' => url('user/login', array('query' => drupal_get_destination())),
+                )),
+                'localized_options' => array('html' => TRUE),
+              ),
+            );
+          }
         }
       }
       $data['actions']['output'] = array_merge($data['actions']['output'], $links);
diff --git a/core/modules/forum/lib/Drupal/forum/Tests/ForumAnonymousTest.php b/core/modules/forum/lib/Drupal/forum/Tests/ForumAnonymousTest.php
new file mode 100644
index 0000000..b0f7eaf
--- /dev/null
+++ b/core/modules/forum/lib/Drupal/forum/Tests/ForumAnonymousTest.php
@@ -0,0 +1,61 @@
+<?php
+
+/**
+ * @file
+ * Definition of Drupal\forum\Tests\ForumAnonymousTest.
+ */
+
+namespace Drupal\forum\Tests;
+
+use Drupal\simpletest\WebTestBase;
+
+/**
+ * Tests anonymous user messages.
+ */
+class ForumAnonymousTest extends WebTestBase {
+
+  public static function getInfo() {
+    return array(
+      'name' => 'Forum anonymous',
+      'description' => 'Tests anonymous user messages.',
+      'group' => 'Forum',
+    );
+  }
+
+  function setUp() {
+    parent::setUp('taxonomy', 'comment', 'forum');
+
+    // Create a test user.
+    $web_user = $this->drupalCreateUser(array('create forum content', 'edit own forum content', 'edit any forum content', 'administer nodes'));
+    $this->drupalLogin($web_user);
+  }
+
+  /**
+   * Tests the presence of the message "Log in to post new content in the forum"
+   * when the user is anonymous and the authenticated does not have the "Create
+   * new content" permission.
+   */
+  function testAnonymousForumMessage() {
+    $langcode = LANGUAGE_NOT_SPECIFIED;
+
+    // The forum ID to use.
+    $tid = 1;
+
+    // Create a test node.
+    $title = $this->randomName(20);
+    $edit = array(
+      'title' => $title,
+      "body[$langcode][0][value]" => $this->randomName(25),
+      "taxonomy_forums[und]" => array(1),
+    );
+
+    // Create the forum topic, preselecting the forum ID via a URL parameter.
+    $this->drupalPost('node/add/forum/' . $tid, $edit, t('Save'));
+    $this->drupalLogout();
+
+    // Access the forum list as an anonymous user and test for presence of
+    // message.
+    $this->drupalGet('forum');
+    $this->assertNoRaw(t('<a href="@login">Log in</a> to post new content in the forum.', array('@login' => url('user/login', array('query' => array('destination' => 'forum'))))), 'Log in or register message does not appear.');
+  }
+}
