Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
admin_toolbar
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
admin_toolbar
Commits
1496ae3a
Commit
1496ae3a
authored
3 years ago
by
Pierre Rudloff
Committed by
Romain Jarraud
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3248234
by prudloff: Access filter is unnecessary for admin user
parent
3eec1ccc
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!14
Issue #3248234: Access filter is unnecessary for admin user
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
admin_toolbar_links_access_filter/admin_toolbar_links_access_filter.module
+5
-0
5 additions, 0 deletions
...ks_access_filter/admin_toolbar_links_access_filter.module
with
5 additions
and
0 deletions
admin_toolbar_links_access_filter/admin_toolbar_links_access_filter.module
+
5
−
0
View file @
1496ae3a
...
...
@@ -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
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment