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 |
|---|---|---|---|
| #3 | drupal-menu_replace_user_access_2062005-3.patch | 569 bytes | internetdevels |
| #1 | drupal-menu_replace_user_access_2062005.patch | 2.73 KB | internetdevels |
Comments
Comment #1
internetdevels commentedIn some cases $request does not contain information about account. I've used $request instead, but looks like this issue requires more deep investigation.
Comment #2
andypostDepends on #2048223: Add $account argument to AccessCheckInterface::access() method and use the current_user service
Use Drupal::currentUser() service https://drupal.org/node/2032447
Comment #3
internetdevels commentedOnly one change left after re-rolling.
Comment #4
andypostgreat
Comment #5
catchCommitted/pushed to 8.x, thanks!