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:
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | drupal-book_replace_user_access-2061973-6.patch | 4.15 KB | naveenvalecha |
| #3 | drupal-book_replace_user_access-2061973.patch | 5.84 KB | internetdevels |
| #3 | interdiff.txt | 3.33 KB | internetdevels |
| #1 | drupal-book_replace_user_access-2061973.patch | 5.7 KB | internetdevels |
Comments
Comment #1
internetdevels commentedPatch attached.
Comment #3
internetdevels commentedAgain problem with anonymous and Drupal::request(). I've added a workaround, locally test passed.
Comment #4
internetdevels commentedComment #5
andypostAll should be Drupal::currentUser() service
Comment #6
naveenvalechaThe patch #3 no longer applied.So rewrote the patch and there is no interdiff.Also used the
Drupal::currentUser()service as in #5. So needs reviewComment #7
andypostAwesome!
Comment #8
alexpottCommitted 2e493af and pushed to 8.x. Thanks!