diff options
author | Morris Jobke <hey@morrisjobke.de> | 2017-07-07 10:46:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-07 10:46:45 +0200 |
commit | 172b4bb6d211ae1977b158e0b0578156245d5b3a (patch) | |
tree | 88ab5a465d0c5b6ff395e55e60218108f00ce8e4 /lib | |
parent | d23bc9a99a6aa59aac9a0635ebbb7fa95fcba05a (diff) | |
parent | 6abbe4e9625958769b6d1996a00de56e73001f55 (diff) | |
download | nextcloud-server-172b4bb6d211ae1977b158e0b0578156245d5b3a.tar.gz nextcloud-server-172b4bb6d211ae1977b158e0b0578156245d5b3a.zip |
Merge pull request #5615 from nextcloud/issue-5286-fix-navigation-entries-for-group-restricted-apps
Don't load navigation entries of restricted apps
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/NavigationManager.php | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/private/NavigationManager.php b/lib/private/NavigationManager.php index 16552005931..b854b44b340 100644 --- a/lib/private/NavigationManager.php +++ b/lib/private/NavigationManager.php @@ -216,7 +216,18 @@ class NavigationManager implements INavigationManager { if ($this->appManager === 'null') { return; } - foreach ($this->appManager->getInstalledApps() as $app) { + + if ($this->userSession->isLoggedIn()) { + $apps = $this->appManager->getEnabledAppsForUser($this->userSession->getUser()); + } else { + $apps = $this->appManager->getInstalledApps(); + } + + foreach ($apps as $app) { + if (!$this->userSession->isLoggedIn() && !$this->appManager->isEnabledForUser($app, $this->userSession->getUser())) { + continue; + } + // load plugins and collections from info.xml $info = $this->appManager->getAppInfo($app); if (empty($info['navigations'])) { |