fix(navigation): hide app icon when app not enabled for the user#41718
Merged
Conversation
NavigationManager::init() built the app menu entries from getInstalledApps() and only filtered on the admin role, never checking per-user enablement. Apps enabled for a specific group therefore showed their navigation icon for every user, and clicking it bounced non-members back to the Files app. Skip apps that are not enabled for the current user, mirroring the per-user check already used for the web navigation entry. Fixes #41717 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
phil-davis
approved these changes
Jul 24, 2026
Contributor
|
Tested on my local install, works. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #41717
When an app is enabled only for a specific group (via the admin apps UI), its navigation icon in the top-left app menu was shown to every user — including users not in that group. Clicking the icon then bounced the non-member back to the Files app.
Root cause
OC\NavigationManager::init()built the app menu entries by iteratinggetInstalledApps()(all non-disabled apps, including group-restricted ones) and its only filter was theadminrole check. It never calledisEnabledForUser(). Since a group-enabled app'senabledvalue is a JSON group array (not'no'), it survives the "installed" filter and its icon was emitted for all users.Notably, the special-case
webnav item (suppressWebNavItem()) already did the correct per-userisEnabledForUser('web')check — that gate was simply missing from the main app loop.Fix
Skip apps that are not enabled for the current user in the navigation build loop, mirroring the existing web check.
Tests
testAppNotEnabledForUserIsNotShown— fails before the fix, passes after.testWithAppManagermocks to account for the newisEnabledForUsercall.NavigationManagerTestcases pass (11 tests, 49 assertions).Note
The follow-up comment on the issue about
files_texteditoris a separate, correct behavior — those apps have no own<navigation>entry and integrate into Files, so they are unaffected. This change targets apps with their own navigation icon, like Notes.🤖 Generated with Claude Code