--- content_translation-translate-tab-set-3014209-15-combined-2137815-19.patch	2020-10-19 22:35:32.742474100 -0700
+++ content_translation-translate-tab-set-3014209-15-combined-2137815-24.patch	2020-10-19 22:35:49.734195300 -0700
@@ -1,8 +1,8 @@
 diff --git a/core/modules/content_translation/content_translation.module b/core/modules/content_translation/content_translation.module
-index 10f546dfd5..9f1a53030c 100644
+index f6c4e9cf0a..1d581c3a23 100644
 --- a/core/modules/content_translation/content_translation.module
 +++ b/core/modules/content_translation/content_translation.module
-@@ -372,9 +372,17 @@ function content_translation_menu_links_discovered_alter(array &$links) {
+@@ -373,6 +373,13 @@ function content_translation_menu_links_discovered_alter(array &$links) {
   */
  function content_translation_translate_access(EntityInterface $entity) {
    $account = \Drupal::currentUser();
@@ -15,12 +15,7 @@
 +  }
    $condition = $entity instanceof ContentEntityInterface && $entity->access('view') &&
      !$entity->getUntranslated()->language()->isLocked() && \Drupal::languageManager()->isMultilingual() && $entity->isTranslatable() &&
--    ($account->hasPermission('create content translations') || $account->hasPermission('update content translations') || $account->hasPermission('delete content translations'));
-+    ($account->hasPermission('create content translations') || $account->hasPermission('update content translations') || $account->hasPermission('delete content translations')) &&
-+    !is_null($bundle_permission) && $account->hasPermission($bundle_permission);
-   return AccessResult::allowedIf($condition)->cachePerPermissions()->addCacheableDependency($entity);
- }
- 
+     ($account->hasPermission('create content translations') || $account->hasPermission('update content translations') || $account->hasPermission('delete content translations') ||
 diff --git a/core/modules/content_translation/src/Access/ContentTranslationManageAccessCheck.php b/core/modules/content_translation/src/Access/ContentTranslationManageAccessCheck.php
 index 849018ae79..23f9a442c7 100644
 --- a/core/modules/content_translation/src/Access/ContentTranslationManageAccessCheck.php
@@ -62,10 +57,10 @@
      return AccessResult::neutral();
    }
 diff --git a/core/modules/content_translation/src/ContentTranslationHandler.php b/core/modules/content_translation/src/ContentTranslationHandler.php
-index 08c3ab3f8a..b9b67fcb5e 100644
+index 12a579ec04..ad1b70421e 100644
 --- a/core/modules/content_translation/src/ContentTranslationHandler.php
 +++ b/core/modules/content_translation/src/ContentTranslationHandler.php
-@@ -285,13 +285,16 @@ public function getTranslationAccess(EntityInterface $entity, $op) {
+@@ -285,11 +285,10 @@ public function getTranslationAccess(EntityInterface $entity, $op) {
      // @todo Move this logic into a translation access control handler checking also
      //   the translation language and the given account.
      $entity_type = $entity->getEntityType();
@@ -79,17 +74,10 @@
 +    if ($this->currentUser->hasPermission('translate any entity')) {
 +      $bundle_permission = TRUE;
      }
--    return AccessResult::allowedIf($translate_permission && $this->currentUser->hasPermission("$op content translations"))->cachePerPermissions();
-+    elseif ($permission_granularity = $entity_type->getPermissionGranularity()) {
-+      // Check bundle translation permission.
-+      $bundle_permission = $this->currentUser->hasPermission($permission_granularity == 'bundle' ? "translate {$entity->bundle()} {$entity->getEntityTypeId()}" : "translate {$entity->getEntityTypeId()}");
-+    }
-+    return AccessResult::allowedIf($bundle_permission && $this->currentUser->hasPermission("$op content translations"))->cachePerPermissions();
-   }
- 
-   /**
+     $access = AccessResult::allowedIf(($translate_permission && $this->currentUser->hasPermission("$op content translations")))->cachePerPermissions();
+     if (!$access->isAllowed()) {
 diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationContextualLinksTest.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationContextualLinksTest.php
-index b958fa1af6..495f991d84 100644
+index 51058b89ee..d8dd5ee4fb 100644
 --- a/core/modules/content_translation/tests/src/Functional/ContentTranslationContextualLinksTest.php
 +++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationContextualLinksTest.php
 @@ -98,6 +98,7 @@ protected function setUp(): void {
@@ -101,19 +89,10 @@
      $this->translator = $this->drupalCreateUser($permissions);
    }
 diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationOperationsTest.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationOperationsTest.php
-index 37bc9b8fa6..72c73f65ad 100644
+index 94de9378ad..31eca4ec7c 100644
 --- a/core/modules/content_translation/tests/src/Functional/ContentTranslationOperationsTest.php
 +++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationOperationsTest.php
-@@ -64,7 +64,7 @@ protected function setUp(): void {
-     \Drupal::service('router.builder')->rebuild();
- 
-     $this->baseUser1 = $this->drupalCreateUser(['access content overview']);
--    $this->baseUser2 = $this->drupalCreateUser(['access content overview', 'create content translations', 'update content translations', 'delete content translations']);
-+    $this->baseUser2 = $this->drupalCreateUser(['access content overview', 'create content translations', 'update content translations', 'delete content translations', 'translate any entity']);
-   }
- 
-   /**
-@@ -138,7 +138,7 @@ public function testOperationTranslateLink() {
+@@ -141,7 +141,7 @@ public function testOperationTranslateLink() {
     */
    public function testContentTranslationOverviewAccess() {
      $access_control_handler = \Drupal::entityTypeManager()->getAccessControlHandler('node');
@@ -135,7 +114,7 @@
      $this->translator = $this->drupalCreateUser($permissions);
    }
 diff --git a/core/modules/node/tests/src/Functional/NodeAccessLanguageFallbackTest.php b/core/modules/node/tests/src/Functional/NodeAccessLanguageFallbackTest.php
-index b0215c38b1..a01f60d6c3 100644
+index 111b556f92..ea28a8e3c1 100644
 --- a/core/modules/node/tests/src/Functional/NodeAccessLanguageFallbackTest.php
 +++ b/core/modules/node/tests/src/Functional/NodeAccessLanguageFallbackTest.php
 @@ -71,6 +71,7 @@ public function testNodeAccessLanguageFallback() {
