From a39c7bf4643fdaa17e62ea503fede1c2f4a30d35 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Mon, 23 Feb 2015 15:26:12 +0100 Subject: Add FileAccess trait for commands --- lib/private/command/fileaccess.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 lib/private/command/fileaccess.php (limited to 'lib/private/command/fileaccess.php') diff --git a/lib/private/command/fileaccess.php b/lib/private/command/fileaccess.php new file mode 100644 index 00000000000..5de00862fac --- /dev/null +++ b/lib/private/command/fileaccess.php @@ -0,0 +1,18 @@ + + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +namespace OC\Command; + +use OCP\IUser; + +trait FileAccess { + protected function getUserFolder(IUser $user) { + \OC_Util::setupFS($user->getUID()); + return \OC::$server->getUserFolder($user->getUID()); + } +} -- cgit v1.2.3