Skip to content

[6.x] Hide content nav items with nothing viewable in the selected site - #15384

Open
duncanmcclean wants to merge 2 commits into
6.xfrom
nav-items-selected-site
Open

[6.x] Hide content nav items with nothing viewable in the selected site#15384
duncanmcclean wants to merge 2 commits into
6.xfrom
nav-items-selected-site

Conversation

@duncanmcclean

@duncanmcclean duncanmcclean commented Sep 7, 2026

Copy link
Copy Markdown
Member

This pull request fixes an issue where the Collections, Navigation and Globals nav items were shown to non-super users in a site where they couldn't view any collections, navs or global sets, leaving a parent item with no children.

This was happening because the parent items are gated by the index policy, which checks whether the user can view any content in any site, while the child items are filtered down to the selected site.

This PR fixes it by letting the index policy be scoped to a site ($user->can('index', [GlobalSet::class, $site])) and having the CP nav pass the selected site. Calling index without a site behaves as before, so the listing pages are unaffected.

Fixes #10152
Related: #9583

duncanmcclean and others added 2 commits September 7, 2026 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Globals" nav item visible for non-super-user in multisite, even without permission to manage globals in selected site

1 participant