Commit 7159e9ca authored by alexpott's avatar alexpott

Issue #2495209 by yogen.prasad, Manjit.Singh: 'Blocks administration page'...

Issue #2495209 by yogen.prasad, Manjit.Singh: 'Blocks administration page' link offered to users with no access
parent 1fc6e00b
...@@ -46,10 +46,10 @@ function menu_ui_help($route_name, RouteMatchInterface $route_match) { ...@@ -46,10 +46,10 @@ function menu_ui_help($route_name, RouteMatchInterface $route_match) {
$output .= '</dl>'; $output .= '</dl>';
return $output; return $output;
} }
if ($route_name == 'entity.menu.add_form' && \Drupal::moduleHandler()->moduleExists('block')) { if ($route_name == 'entity.menu.add_form' && \Drupal::moduleHandler()->moduleExists('block') && \Drupal::currentUser()->hasPermission('administer blocks')) {
return '<p>' . t('You can enable the newly-created block for this menu on the <a href="!blocks">Block layout page</a>.', array('!blocks' => \Drupal::url('block.admin_display'))) . '</p>'; return '<p>' . t('You can enable the newly-created block for this menu on the <a href="!blocks">Block layout page</a>.', array('!blocks' => \Drupal::url('block.admin_display'))) . '</p>';
} }
elseif ($route_name == 'entity.menu.collection' && \Drupal::moduleHandler()->moduleExists('block')) { elseif ($route_name == 'entity.menu.collection' && \Drupal::moduleHandler()->moduleExists('block') && \Drupal::currentUser()->hasPermission('administer blocks')) {
return '<p>' . t('Each menu has a corresponding block that is managed on the <a href="!blocks">Block layout page</a>.', array('!blocks' => \Drupal::url('block.admin_display'))) . '</p>'; return '<p>' . t('Each menu has a corresponding block that is managed on the <a href="!blocks">Block layout page</a>.', array('!blocks' => \Drupal::url('block.admin_display'))) . '</p>';
} }
} }
......
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