Skip to content

feat(navigation): let apps remove navigation entries - #64858

Open
karlitschek wants to merge 1 commit into
masterfrom
feat/navigation-entries-filter-event
Open

karlitschek wants to merge 1 commit into
masterfrom
feat/navigation-entries-filter-event

Conversation

@karlitschek

Copy link
Copy Markdown
Member

Apps can add navigation entries through LoadAdditionalEntriesEvent but cannot take any away. An app that gives some users access to itself only, such as Social's self-registered external users (nextcloud/social branch feat/external-users), then has to hide the app menu with CSS while the page still lists every app in its initial state.

NavigationManager::getAll() now dispatches NavigationEntriesFilterEvent with the entries of the requested type before sorting. Listeners can only remove entries; added or changed entries are ignored. The event is only dispatched when an app listens for it.

Tests: three new cases in tests/lib/NavigationManagerTest.php.

AI disclosure: this change was written with Claude Code and reviewed by the contributor.

🤖 Generated with Claude Code

Apps can add navigation entries (LoadAdditionalEntriesEvent) but not take
any away. An app that gives some users access to itself only, like the
Social app's self-registered external users, then has to hide the app menu
with CSS while the page still carries every app in its initial state.

NavigationManager::getAll() now dispatches NavigationEntriesFilterEvent with
the entries of the requested type before sorting them. A listener can only
remove entries: entries it adds or changes are ignored, so the event cannot
be used to rewrite another app's link. The event is only dispatched when an
app listens for it.

Assisted-by: ClaudeCode:claude-opus-5-5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Frank Karlitschek <frank.karlitschek@nextcloud.com>
@karlitschek
karlitschek requested a review from a team as a code owner September 27, 2026 16:43
@karlitschek
karlitschek requested review from Altahrim, leftybournes, provokateurin and salmart-dev and removed request for a team September 27, 2026 16:43
@karlitschek

Copy link
Copy Markdown
Member Author

The idea is that people can register themselves for the Social app and can use the normal login and Platform. But this users should have only access to Social and not Files or Dashboard or other standard apps. So it would be great to hide the not relevant apps. This should also be backported.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants