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
#7 drupal-edit_replace_user_access-2061983-7.patch435 bytesrhm5000
PASSED: [[SimpleTest]]: [MySQL] 58,486 pass(es). View
#7 interdiff-2061983-1-7.txt485 bytesrhm5000
#1 drupal-edit_replace_user_access-2061983.patch460 bytesInternetDevels
FAILED: [[SimpleTest]]: [MySQL] 57,853 pass(es), 39 fail(s), and 3 exception(s). View

Comments

InternetDevels’s picture

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

Pretty simple one.

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

The last submitted patch, drupal-edit_replace_user_access-2061983.patch, failed testing.

InternetDevels’s picture

Status: Needs work » Needs review

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

The last submitted patch, drupal-edit_replace_user_access-2061983.patch, failed testing.

andypost’s picture

Component: user system » edit.module
+++ b/core/modules/edit/edit.module
@@ -53,7 +53,7 @@ function edit_permission() {
+  if (!Drupal::request()->attributes->get('_account')->hasPermission('access in-place editing')) {

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

Wim Leers’s picture

Issue tags: +php-novice
rhm5000’s picture

FileSize
485 bytes
435 bytes
PASSED: [[SimpleTest]]: [MySQL] 58,486 pass(es). View
rhm5000’s picture

Status: Needs work » Needs review
Wim Leers’s picture

Status: Needs review » Reviewed & tested by the community

This has extensive test coverage, so if it comes back green, it's definitely good to go :) Thanks!

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed cd882b6 and pushed to 8.x. Thanks!

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