diff options
Diffstat (limited to 'apps/files_trashbin/lib/Service/ConfigService.php')
-rw-r--r-- | apps/files_trashbin/lib/Service/ConfigService.php | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/apps/files_trashbin/lib/Service/ConfigService.php b/apps/files_trashbin/lib/Service/ConfigService.php new file mode 100644 index 00000000000..9e7826fe580 --- /dev/null +++ b/apps/files_trashbin/lib/Service/ConfigService.php @@ -0,0 +1,27 @@ +<?php + +declare(strict_types=1); + +namespace OCA\Files_Trashbin\Service; + +use OCP\AppFramework\Services\IInitialState; +use OCP\IConfig; +use OCP\Server; + +/** + * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later + */ +class ConfigService { + public static function getDeleteFromTrashEnabled(): bool { + return Server::get(IConfig::class)->getSystemValueBool('files.trash.delete', true); + } + + public static function injectInitialState(IInitialState $initialState): void { + $initialState->provideLazyInitialState('config', function () { + return [ + 'allow_delete' => ConfigService::getDeleteFromTrashEnabled(), + ]; + }); + } +} |