diff --git a/modules/salesforce_mapping_ui/salesforce_mapping_ui.module b/modules/salesforce_mapping_ui/salesforce_mapping_ui.module index 09986c0c6616f2194785a588b0ea55b3969b4c3d..5935eca46b004312ec2e1413440ab026e175500c 100644 --- a/modules/salesforce_mapping_ui/salesforce_mapping_ui.module +++ b/modules/salesforce_mapping_ui/salesforce_mapping_ui.module @@ -79,9 +79,17 @@ function salesforce_mapping_ui_menu_local_actions_alter(&$local_actions) { */ function salesforce_mapping_ui_entity_operation(EntityInterface $entity) { $operations = []; - if (\Drupal::entityTypeManager() + $has_mapping_view_access = FALSE; + + foreach (\Drupal::entityTypeManager() ->getStorage('salesforce_mapping') - ->loadByEntity($entity)) { + ->loadByEntity($entity) as $mapping) { + if ($mapping->access('view')) { + $has_mapping_view_access = TRUE; + } + } + + if ($has_mapping_view_access) { $operations['salesforce'] = [ 'title' => t('Salesforce'), 'weight' => 200,