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 |
|---|---|---|---|
| #18 | drupal_language_replace_user_access-2062001-18.patch | 567 bytes | internetdevels |
| #14 | drupal-language_replace_user_access-2062001-14.patch | 1.51 KB | deimos |
Comments
Comment #1
internetdevels commentedPatch attached.
Comment #2
andypostNice clean-up!
Suppose this function would be droped in wscci conversion for 'language_admin_edit_form' and 'language_admin_delete_form'
Comment #3
tim.plunkettThis method has the account passed to it directly.
Comment #4
andypostShould be Drupal::currentUser() according https://drupal.org/node/2032447
Comment #5
internetdevels commentedPatch attached.
Comment #6
internetdevels commentedFixed typo.
Comment #7
andypostPlease do not use $account here. Drupal::currentUser()->hasPermission() works fine
This is a hack, but reasonable
Comment #8
andypostUse this to replace 2 hack
Comment #9
andypostComment #10
internetdevels commentedNew one.
Comment #11
andypost$account = $this->prepareUser($account);
Comment #12
internetdevels commentedFixed issue above.
Comment #13
tim.plunkettThis should be overriding checkAccess() and checkCreateAccess() instead. Then you don't need the prepareUser call.
Comment #14
deimos commentedThanks, corrected patch regarding to comment above.
Comment #15
andypost#14: drupal-language_replace_user_access-2062001-14.patch queued for re-testing.
Comment #16
andypost\Drupal according #2053489: Standardize on \Drupal throughout core
Comment #17
areke commentedThis needs to be re-rolled because the patch no longer applies.
Comment #18
internetdevels commentedComment #19
andypostGreat!
Comment #20
webchickCommitted and pushed to 8.x. Thanks!