Skip to content

fix(navigation): hide app icon when app not enabled for the user#41718

Merged
phil-davis merged 1 commit into
masterfrom
fix/41717-hide-nav-icon-app-not-enabled
Jul 24, 2026
Merged

fix(navigation): hide app icon when app not enabled for the user#41718
phil-davis merged 1 commit into
masterfrom
fix/41717-hide-nav-icon-app-not-enabled

Conversation

@DeepDiver1975

Copy link
Copy Markdown
Member

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 iterating getInstalledApps() (all non-disabled apps, including group-restricted ones) and its only filter was the admin role check. It never called isEnabledForUser(). Since a group-enabled app's enabled value is a JSON group array (not 'no'), it survives the "installed" filter and its icon was emitted for all users.

Notably, the special-case web nav item (suppressWebNavItem()) already did the correct per-user isEnabledForUser('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

  • Added testAppNotEnabledForUserIsNotShown — fails before the fix, passes after.
  • Updated the existing testWithAppManager mocks to account for the new isEnabledForUser call.
  • All NavigationManagerTest cases pass (11 tests, 49 assertions).

Note

The follow-up comment on the issue about files_texteditor is 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

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>
@DeepDiver1975
DeepDiver1975 requested a review from a team as a code owner July 23, 2026 22:00
@phil-davis
phil-davis merged commit fca7a75 into master Jul 24, 2026
29 checks passed
@phil-davis
phil-davis deleted the fix/41717-hide-nav-icon-app-not-enabled branch July 24, 2026 03:06
@phil-davis

Copy link
Copy Markdown
Contributor

Tested on my local install, works.

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.

App icon still shown when app not enabled for a user

2 participants