Capabilities.php 872 B

12345678910111213141516171819202122232425262728293031323334
  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. public function __construct(
  13. private IConfig $config,
  14. private IAppManager $appManager,
  15. ) {
  16. }
  17. /**
  18. * Return this classes capabilities
  19. *
  20. * @return array{files: array{versioning: bool, version_labeling: bool, version_deletion: bool}}
  21. */
  22. public function getCapabilities() {
  23. return [
  24. 'files' => [
  25. 'versioning' => true,
  26. 'version_labeling' => $this->config->getSystemValueBool('enable_version_labeling', true),
  27. 'version_deletion' => $this->config->getSystemValueBool('enable_version_deletion', true),
  28. ]
  29. ];
  30. }
  31. }