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
#11 2062017-replace-user_access-calls-11.patch654 bytesDeimoS
PASSED: [[SimpleTest]]: [MySQL] 58,771 pass(es).
[ View ]
#9 2062017-replace-user_access-calls-9.patch653 byteswesleydv
PASSED: [[SimpleTest]]: [MySQL] 58,778 pass(es).
[ View ]
#3 2062017-replace-user_access-calls-3.patch637 bytesrhm50
PASSED: [[SimpleTest]]: [MySQL] 58,444 pass(es).
[ View ]
#1 drupal-rdf_replace_user_access-2062017.patch1.07 KBInternetDevels
PASSED: [[SimpleTest]]: [MySQL] 57,882 pass(es).
[ View ]

Comments

Status:Active» Needs review
StatusFileSize
new1.07 KB
PASSED: [[SimpleTest]]: [MySQL] 57,882 pass(es).
[ View ]

Here is the patch.

Status:Needs review» Needs work

+++ b/core/modules/rdf/rdf.module
@@ -244,6 +244,7 @@ function rdf_preprocess_html(&$variables) {
+  $account = Drupal::request()->attributes->get('_account');

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

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

Status:Needs review» Reviewed & tested by the community

great!

Status:Reviewed & tested by the community» Fixed

Committed and pushed to 8.x. Thanks!

Status:Fixed» Closed (fixed)

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

Status:Closed (fixed)» Reviewed & tested by the community

Seems that last patch does not commit to core:
http://drupalcode.org/project/drupal.git/blame/HEAD:/core/modules/rdf/rd...

Also I cannot find a commit associated to current issue:
http://drupalcode.org/project/drupal.git?a=search&h=HEAD&st=commit&s=206...

Seems that we need to reopen this issue.

Status:Reviewed & tested by the community» Needs work
Issue tags:+Needs reroll

Patch no longer applies.

Status:Needs work» Needs review
Issue tags:-Needs reroll
StatusFileSize
new653 bytes
PASSED: [[SimpleTest]]: [MySQL] 58,778 pass(es).
[ View ]

Reroll against head

+++ b/core/modules/rdf/rdf.module
@@ -333,7 +333,7 @@ function rdf_preprocess_node(&$variables) {
+      if ($variables['page'] && Drupal::currentUser()->hasPermission('access comments')) {

Should be \Drupal::

StatusFileSize
new654 bytes
PASSED: [[SimpleTest]]: [MySQL] 58,771 pass(es).
[ View ]

corrected

Status:Needs review» Reviewed & tested by the community

Looks OK to me.

Status:Reviewed & tested by the community» Fixed

Committed and pushed to 8.x. Thanks!

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