diff --git a/web/profiles/custom/yalesites_profile/composer.json b/web/profiles/custom/yalesites_profile/composer.json index f0770c51e..63c32efea 100644 --- a/web/profiles/custom/yalesites_profile/composer.json +++ b/web/profiles/custom/yalesites_profile/composer.json @@ -101,7 +101,7 @@ "drupal/section_library": "1.1.1", "drupal/selective_better_exposed_filters": "3.0.3", "drupal/simple_sitemap": "4.2.1", - "drupal/single_content_sync": "1.4.5", + "drupal/single_content_sync": "1.4.6", "drupal/smart_date": "4.1.6", "drupal/twig_tweak": "3.4.0", "drupal/typogrify": "1.4-rc1", diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_core/ys_core.module b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/ys_core.module index fb55473c3..f8876eba7 100644 --- a/web/profiles/custom/yalesites_profile/modules/custom/ys_core/ys_core.module +++ b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/ys_core.module @@ -600,3 +600,17 @@ function ys_core_form_views_exposed_form_alter(&$form, FormStateInterface $form_ } } } + +/** + * Implements hook_menu_local_tasks_alter(). + * + * If the current user is not user 1, remove the single content sync tab. + */ +function ys_core_menu_local_tasks_alter(&$data, $route_name, $cachability) { + foreach ($data['tabs'][0] as $key => $tab) { + if (strpos($key, 'single_content_sync') === 0 && + \Drupal::currentUser()->id() != 1) { + unset($data['tabs'][0][$key]); + } + } +}