From 806f926e673021feb5f8dda1beef3dc8dcbcea24 Mon Sep 17 00:00:00 2001 From: Andrey Borysenko Date: Fri, 11 Oct 2024 18:40:24 +0300 Subject: [PATCH] chore: remove "External Apps" menu entry Signed-off-by: Andrey Borysenko --- lib/AppInfo/Application.php | 37 ------------------------------------- 1 file changed, 37 deletions(-) diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index 2d0cac7d..7ec4eb06 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -36,12 +36,6 @@ use OCP\Files\Events\Node\NodeTouchedEvent; use OCP\Files\Events\Node\NodeWrittenEvent; use OCP\IConfig; -use OCP\IGroupManager; -use OCP\IL10N; -use OCP\INavigationManager; -use OCP\IURLGenerator; -use OCP\IUser; -use OCP\IUserSession; use OCP\SabrePluginEvent; use OCP\Settings\Events\DeclarativeSettingsGetValueEvent; use OCP\Settings\Events\DeclarativeSettingsRegisterFormEvent; @@ -110,9 +104,7 @@ public function register(IRegistrationContext $context): void { } public function boot(IBootContext $context): void { - $server = $context->getServerContainer(); try { - $context->injectFn($this->registerExAppsManagementNavigation(...)); $context->injectFn($this->registerExAppsMenuEntries(...)); } catch (NotFoundExceptionInterface|ContainerExceptionInterface|Throwable) { } @@ -127,35 +119,6 @@ public function registerDavAuth(): void { }); } - /** - * Register ExApps management navigation entry right after default Apps management link. - * - * @throws ContainerExceptionInterface - * @throws NotFoundExceptionInterface - */ - private function registerExAppsManagementNavigation(IUserSession $userSession): void { - $container = $this->getContainer(); - /** @var IGroupManager $groupManager */ - $groupManager = $container->get(IGroupManager::class); - /** @var IUser $user */ - $user = $userSession->getUser(); - if ($groupManager->isInGroup($user->getUID(), 'admin')) { - $container->get(INavigationManager::class)->add(function () use ($container) { - $urlGenerator = $container->get(IURLGenerator::class); - $l10n = $container->get(IL10N::class); - return [ - 'id' => self::APP_ID, - 'type' => 'settings', - 'order' => 6, - 'href' => $urlGenerator->linkToRoute('app_api.ExAppsPage.viewApps'), - 'icon' => $urlGenerator->imagePath('app_api', 'app-dark.svg'), - 'target' => '_blank', - 'name' => $l10n->t('External Apps'), - ]; - }); - } - } - private function registerExAppsMenuEntries(): void { $container = $this->getContainer(); $menuEntryService = $container->get(TopMenuService::class);