diff options
author | Joas Schilling <coding@schilljs.com> | 2017-07-05 13:52:51 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2017-07-05 13:52:51 +0200 |
commit | 6abbe4e9625958769b6d1996a00de56e73001f55 (patch) | |
tree | 719114ae3d49350f50b5a2f5cddf2b85bf386efe /lib | |
parent | 1cbb7a18d8d4e1153a6b54e55a8e0f4ed71f167f (diff) | |
download | nextcloud-server-6abbe4e9625958769b6d1996a00de56e73001f55.tar.gz nextcloud-server-6abbe4e9625958769b6d1996a00de56e73001f55.zip |
Don't load navigation entries of restricted apps
Signed-off-by: Joas Schilling <coding@schilljs.com>
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'])) { |