summaryrefslogtreecommitdiffstats
path: root/lib/private/NavigationManager.php
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2017-07-05 13:52:51 +0200
committerJoas Schilling <coding@schilljs.com>2017-07-05 13:52:51 +0200
commit6abbe4e9625958769b6d1996a00de56e73001f55 (patch)
tree719114ae3d49350f50b5a2f5cddf2b85bf386efe /lib/private/NavigationManager.php
parent1cbb7a18d8d4e1153a6b54e55a8e0f4ed71f167f (diff)
downloadnextcloud-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/private/NavigationManager.php')
-rw-r--r--lib/private/NavigationManager.php13
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'])) {