f7cloud_client/apps/files_trashbin/lib/Service/ConfigService.php
root 8b6a0139db f7cloud_client
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-17 22:59:26 +00:00

28 lines
687 B
PHP

<?php
declare(strict_types=1);
namespace OCA\Files_Trashbin\Service;
use OCP\AppFramework\Services\IInitialState;
use OCP\IConfig;
use OCP\Server;
/**
* SPDX-FileCopyrightText: 2025 F7cloud GmbH and F7cloud 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(),
];
});
}
}