Support from Acquia helps fund testing for Drupal Acquia logo

Comments

InternetDevels’s picture

Status: Active » Needs review
FileSize
615 bytes

Here is the patch.

larowlan’s picture

I think the dx of this needs work

larowlan’s picture

Status: Needs review » Needs work

We should be injecting the Request into the block plugin here. See https://drupal.org/node/2012118.

andypost’s picture

Component: user system » forum.module
Priority: Minor » Normal
+++ b/core/modules/forum/lib/Drupal/forum/Plugin/Block/ForumBlockBase.php
@@ -31,7 +31,7 @@ public function settings() {
+    return \Drupal::request()->attributes->get('_account')->hasPermission('access content');

Use Drupal::currentUser() service https://drupal.org/node/2032447

or probably #2048223: Add $account argument to AccessCheckInterface::access() method and use the current_user service

larowlan’s picture

Status: Needs work » Postponed

Lets get #1951268: Convert /forum and /forum/% to new router, remove forum_forum_load(), forum_get_topics(), create Forum service in first (which has been reviewed by @catch, @alexpott, @tim.plunkett, @jibran and @dawehner so must be close)

InternetDevels’s picture

Status: Postponed » Needs review
FileSize
590 bytes

As issue from comment above is resolved new patch attached.

andypost’s picture

+++ b/core/modules/forum/lib/Drupal/forum/Plugin/Block/ForumBlockBase.php
@@ -31,7 +31,7 @@ public function settings() {
   public function access() {
-    return user_access('access content');
+    return \Drupal::currentUser()->hasPermission('access content');

Suppose this require new issue to pass $account to access method of blockBase, at least this require proper service injection

InternetDevels’s picture

areke’s picture

Issue summary: View changes
Status: Needs review » Needs work
Issue tags: +Needs reroll

The patch doesn't apply, and needs to be re-rolled.

slimbk’s picture

Assigned: Unassigned » slimbk
Issue tags: +TUNIS_2013_DECEMBER
andypost’s picture

Status: Needs work » Closed (cannot reproduce)

Already fixed