SessionStorageWrapper.php 665 B

12345678910111213141516171819202122232425
  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 $arguments ['storage' => $storage]
  16. */
  17. public function __construct($arguments) {
  18. // disable sharing permission
  19. $arguments['mask'] = Constants::PERMISSION_ALL & ~Constants::PERMISSION_SHARE;
  20. parent::__construct($arguments);
  21. }
  22. }