Closed (duplicate)
Project:
Drupal core
Version:
8.0.x-dev
Component:
user system
Priority:
Minor
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
10 Aug 2013 at 09:02 UTC
Updated:
29 Jul 2014 at 22:45 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
bald_man commentedI take this issue for me on CodeSprintUA/CIS
Comment #2
bald_man commentedComment #3
michaelhiiva commentedComment #4
michaelhiiva commentedComment #5
andypost#4: 2061961-replace-user_access-calls-4.patch queued for re-testing.
Comment #7
internetdevels commentedComment #8
internetdevels commentedComment #10
ipo4ka704 commented7: replace-useraccess-calls-2061961-7.patch queued for re-testing.
Comment #12
internetdevels commentedComment #13
andypostPatch needs re-work to not use global user - see #2047951: [META] Remove calls to deprecated global $user and $GLOBALS['user']
$account is not needed here,
just use \Drupal::currentUser()->hasPermission()
global $user is the same \Drupal:currentUser()
Comment #14
internetdevels commentedComment #15
andypostPlease do not add new variable ($account), see my previous review (1)
$account = $account ?: \Drupal::currentuser();
The passed account could be different from current user
Comment #16
internetdevels commentedComment #17
andypostAnd another round...
1) Once there's more then one
\Drupal::currentUser()execution it makes sense to use variable2) Do not add extra space before
\Drupal::3) Please check carefully the functions that have
$accountargument passed inIn case like this better revert to $account, to minimize function calls
the same
Comment #18
internetdevels commentedComment #19
andypostNow it's good to go
Comment #20
xjmThanks for your work on this! See #2048171-17: [meta] Replace user_access() calls with $account->hasPermission() wherever possible..
Comment #21
xjmComment #22
xjm18: drupal_content_translation_replace-useraccess-calls-2061961-18.patch queued for re-testing.
Comment #23
xjmOops. :)
Comment #26
ipo4ka704 commented18: drupal_content_translation_replace-useraccess-calls-2061961-18.patch queued for re-testing.
Comment #27
andypostThis patch should be merged into #2061977: Replace user_access() calls with $account->hasPermission() in all core modules except user
Comment #29
herom commentedtestbot fun! stop that, will you?