Capabilities.php 886 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
  5. * SPDX-License-Identifier: AGPL-3.0-only
  6. */
  7. namespace OCA\Files;
  8. use OCP\Capabilities\ICapability;
  9. use OCP\IConfig;
  10. class Capabilities implements ICapability {
  11. protected IConfig $config;
  12. public function __construct(IConfig $config) {
  13. $this->config = $config;
  14. }
  15. /**
  16. * Return this classes capabilities
  17. *
  18. * @return array{files: array{bigfilechunking: bool, blacklisted_files: array<mixed>, forbidden_filename_characters: array<string>}}
  19. */
  20. public function getCapabilities() {
  21. return [
  22. 'files' => [
  23. 'bigfilechunking' => true,
  24. 'blacklisted_files' => (array)$this->config->getSystemValue('blacklisted_files', ['.htaccess']),
  25. 'forbidden_filename_characters' => \OCP\Util::getForbiddenFileNameChars(),
  26. ],
  27. ];
  28. }
  29. }