Commit 542517f6 authored by webchick's avatar webchick

Issue #2062027 by InternetDevels: Replace user_access() calls with...

Issue #2062027 by InternetDevels: Replace user_access() calls with ->hasPermission() in taxonomy module.
parent 614db344
......@@ -24,15 +24,15 @@ class TermAccessController extends EntityAccessController {
protected function checkAccess(EntityInterface $entity, $operation, $langcode, AccountInterface $account) {
switch ($operation) {
case 'view':
return user_access('access content', $account);
return $account->hasPermission('access content');
break;
case 'update':
return user_access("edit terms in {$entity->bundle()}", $account) || user_access('administer taxonomy', $account);
return $account->hasPermission("edit terms in {$entity->bundle()}") || $account->hasPermission('administer taxonomy');
break;
case 'delete':
return user_access("delete terms in {$entity->bundle()}", $account) || user_access('administer taxonomy', $account);
return $account->hasPermission("delete terms in {$entity->bundle()}") || $account->hasPermission('administer taxonomy');
break;
}
}
......@@ -41,7 +41,7 @@ protected function checkAccess(EntityInterface $entity, $operation, $langcode, A
* {@inheritdoc}
*/
protected function checkCreateAccess(AccountInterface $account, array $context, $entity_bundle = NULL) {
return user_access('administer taxonomy', $account);
return $account->hasPermission('administer taxonomy');
}
}
......@@ -22,14 +22,14 @@ class VocabularyAccessController extends EntityAccessController {
* {@inheritdoc}
*/
protected function checkAccess(EntityInterface $entity, $operation, $langcode, AccountInterface $account) {
return user_access('administer taxonomy', $account);
return $account->hasPermission('administer taxonomy');
}
/**
* {@inheritdoc}
*/
protected function checkCreateAccess(AccountInterface $account, array $context, $entity_bundle = NULL) {
return user_access('administer taxonomy', $account);
return $account->hasPermission('administer taxonomy');
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment