FileAccess.php 460 B

123456789101112131415161718192021
  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 OC\Command;
  8. use OCP\IUser;
  9. trait FileAccess {
  10. protected function setupFS(IUser $user) {
  11. \OC_Util::setupFS($user->getUID());
  12. }
  13. protected function getUserFolder(IUser $user) {
  14. $this->setupFS($user);
  15. return \OC::$server->getUserFolder($user->getUID());
  16. }
  17. }