Let's start to convert all calls to user_access() with the new AccountInterface::hasPermission() method.

Part of #2048171: [meta] Replace user_access() calls with $account->hasPermission() wherever possible.

Change records for this issue:

Files: 
CommentFileSizeAuthor
#6 2062031-replace-user_access-calls-6.patch684 bytesrhm50
PASSED: [[SimpleTest]]: [MySQL] 58,106 pass(es).
[ View ]
#6 interdiff-2062031-1-6.txt832 bytesrhm50
#1 drupal-tour_replace_user_access-2062031.patch782 bytesInternetDevels
FAILED: [[SimpleTest]]: [MySQL] 57,602 pass(es), 39 fail(s), and 3 exception(s).
[ View ]

Comments

Status:Active» Needs review
StatusFileSize
new782 bytes
FAILED: [[SimpleTest]]: [MySQL] 57,602 pass(es), 39 fail(s), and 3 exception(s).
[ View ]

Here is the patch.

Status:Needs review» Needs work
Issue tags:-CodeSprintCIS

The last submitted patch, drupal-tour_replace_user_access-2062031.patch, failed testing.

Status:Needs work» Needs review

Status:Needs review» Needs work
Issue tags:+CodeSprintCIS

The last submitted patch, drupal-tour_replace_user_access-2062031.patch, failed testing.

Component:user system» tour.module

+++ b/core/modules/tour/tour.module
@@ -73,7 +73,8 @@ function tour_library_info() {
+  $account = Drupal::request()->attributes->get('_account');
@@ -107,7 +108,8 @@ function tour_toolbar() {
+  $account = Drupal::request()->attributes->get('_account');

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

Status:Needs work» Needs review
StatusFileSize
new832 bytes
new684 bytes
PASSED: [[SimpleTest]]: [MySQL] 58,106 pass(es).
[ View ]

Status:Needs review» Reviewed & tested by the community

Nice!

Status:Reviewed & tested by the community» Fixed

Committed and pushed to 8.x. Thanks!

Automatically closed -- issue fixed for 2 weeks with no activity.