Capabilities.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Christopher Schäpers <kondou@ts.unde.re>
  6. * @author Joas Schilling <coding@schilljs.com>
  7. * @author Julius Härtl <jus@bitgrid.net>
  8. * @author Roeland Jago Douma <roeland@famdouma.nl>
  9. * @author Tom Needham <tom@owncloud.com>
  10. *
  11. * @license AGPL-3.0
  12. *
  13. * This code is free software: you can redistribute it and/or modify
  14. * it under the terms of the GNU Affero General Public License, version 3,
  15. * as published by the Free Software Foundation.
  16. *
  17. * This program is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU Affero General Public License for more details.
  21. *
  22. * You should have received a copy of the GNU Affero General Public License, version 3,
  23. * along with this program. If not, see <http://www.gnu.org/licenses/>
  24. *
  25. */
  26. namespace OCA\Files;
  27. use OCP\Capabilities\ICapability;
  28. use OCP\IConfig;
  29. class Capabilities implements ICapability {
  30. protected IConfig $config;
  31. public function __construct(IConfig $config) {
  32. $this->config = $config;
  33. }
  34. /**
  35. * Return this classes capabilities
  36. *
  37. * @return array{files: array{bigfilechunking: bool, blacklisted_files: array<mixed>, forbidden_filename_characters: array<string>}}
  38. */
  39. public function getCapabilities() {
  40. return [
  41. 'files' => [
  42. 'bigfilechunking' => true,
  43. 'blacklisted_files' => (array)$this->config->getSystemValue('blacklisted_files', ['.htaccess']),
  44. 'forbidden_filename_characters' => \OCP\Util::getForbiddenFileNameChars(),
  45. ],
  46. ];
  47. }
  48. }