SessionStorageWrapper.php 674 B

123456789101112131415161718192021222324
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2018-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_External\Lib;
  8. use OC\Files\Storage\Wrapper\PermissionsMask;
  9. use OCP\Constants;
  10. /**
  11. * Wrap Storage in PermissionsMask for session ephemeral use
  12. */
  13. class SessionStorageWrapper extends PermissionsMask {
  14. /**
  15. * @param array $parameters ['storage' => $storage]
  16. */
  17. public function __construct(array $parameters) {
  18. // disable sharing permission
  19. $parameters['mask'] = Constants::PERMISSION_ALL & ~Constants::PERMISSION_SHARE;
  20. parent::__construct($parameters);
  21. }
  22. }