Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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 CreditAttribution: InternetDevels commentedPatch attached.
Comment #3
InternetDevels CreditAttribution: InternetDevels commentedAgain problem with anonymous and Drupal::request(). I've added a workaround, locally test passed.
Comment #4
InternetDevels CreditAttribution: 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!