Capabilities.php 978 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
  5. * SPDX-License-Identifier: AGPL-3.0-only
  6. */
  7. namespace OCA\Files_Versions;
  8. use OCP\App\IAppManager;
  9. use OCP\Capabilities\ICapability;
  10. use OCP\IConfig;
  11. class Capabilities implements ICapability {
  12. private IConfig $config;
  13. private IAppManager $appManager;
  14. public function __construct(
  15. IConfig $config,
  16. IAppManager $appManager
  17. ) {
  18. $this->config = $config;
  19. $this->appManager = $appManager;
  20. }
  21. /**
  22. * Return this classes capabilities
  23. *
  24. * @return array{files: array{versioning: bool, version_labeling: bool, version_deletion: bool}}
  25. */
  26. public function getCapabilities() {
  27. return [
  28. 'files' => [
  29. 'versioning' => true,
  30. 'version_labeling' => $this->config->getSystemValueBool('enable_version_labeling', true),
  31. 'version_deletion' => $this->config->getSystemValueBool('enable_version_deletion', true),
  32. ]
  33. ];
  34. }
  35. }