Skip to content
Snippets Groups Projects
Commit d93a0c00 authored by Kevin Paxman's avatar Kevin Paxman
Browse files

ISTWCMS-4874: remove permission check because link adding already checks for access

parent c17200ed
No related branches found
No related tags found
2 merge requests!111Tag 1.0.1,!108Feature/istwcms 4874 l26yan make people and reports show on dashboard toolbar
......@@ -236,23 +236,20 @@ function uw_cfg_common_toolbar_alter(&$items) {
$current_user = \Drupal::currentUser();
// Adjust toolbar for non-admin users.
if ($current_user->hasPermission('administer users')) {
// Add links to "Workbench". 'dashboards' is renamed in
// uw_dashboard_toolbar_alter().
$links = [
'entity.user.collection' => t('People'),
'system.admin_reports' => t('Reports'),
];
foreach ($links as $route => $title) {
$url = Url::fromRoute($route);
if ($url->access()) {
$items['dashboards']['tray']['dashboards']['#items'][] = [
'#type' => 'link',
'#title' => $title,
'#url' => $url,
];
}
// Add links to "Workbench". 'dashboards' is renamed in
// uw_dashboard_toolbar_alter().
$links = [
'entity.user.collection' => t('People'),
'system.admin_reports' => t('Reports'),
];
foreach ($links as $route => $title) {
$url = Url::fromRoute($route);
if ($url->access()) {
$items['dashboards']['tray']['dashboards']['#items'][] = [
'#type' => 'link',
'#title' => $title,
'#url' => $url,
];
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment