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:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

InternetDevels’s picture

Patch attached.

InternetDevels’s picture

Status: Active » Needs review

Forgot to change status.

andypost’s picture

andypost’s picture

Status: Needs review » Reviewed & tested by the community

If bot green

$ git grep user_access core/modules/taxonomy/
core/modules/taxonomy/lib/Drupal/taxonomy/TermAccessController.php:27:        return user_access('access content', $account);
core/modules/taxonomy/lib/Drupal/taxonomy/TermAccessController.php:31:        return user_access("edit terms in {$entity->bundle()}", $account) || user_access('a
core/modules/taxonomy/lib/Drupal/taxonomy/TermAccessController.php:35:        return user_access("delete terms in {$entity->bundle()}", $account) || user_access(
core/modules/taxonomy/lib/Drupal/taxonomy/TermAccessController.php:44:    return user_access('administer taxonomy', $account);
core/modules/taxonomy/lib/Drupal/taxonomy/VocabularyAccessController.php:25:    return user_access('administer taxonomy', $account);
core/modules/taxonomy/lib/Drupal/taxonomy/VocabularyAccessController.php:32:    return user_access('administer taxonomy', $account);
webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 8.x. Thanks!

Automatically closed -- issue fixed for 2 weeks with no activity.