+ $access_result = AccessResult::allowedIf($account->hasPermission('access content') && $entity->isPublished())
+ ->cachePerPermissions()
+ ->addCacheableDependency($entity);
+ if (!$access_result->isAllowed()) {
+ $access_result->setReason("The 'access content' permission is required and the taxonomy term must be published.");
+ }
+ return $access_result;