Skip to content
Snippets Groups Projects
Commit 1496ae3a authored by Pierre Rudloff's avatar Pierre Rudloff Committed by Romain Jarraud
Browse files

Issue #3248234 by prudloff: Access filter is unnecessary for admin user

parent 3eec1ccc
Branches
Tags
1 merge request!14Issue #3248234: Access filter is unnecessary for admin user
......@@ -58,6 +58,11 @@ function admin_toolbar_links_access_filter_preprocess_menu(&$variables) {
* Hides links from admin menu, if user doesn't have access rights.
*/
function admin_toolbar_links_access_filter_filter_non_accessible_links(array &$items) {
if (Drupal::currentUser()->id() == 1) {
// Admin can access everything.
return;
}
$access_manager = \Drupal::accessManager();
foreach ($items as $menu_id => &$item) {
$route_name = NULL;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment