diff options
author | Robin Appelman <robin@icewind.nl> | 2016-05-17 21:40:55 +0200 |
---|---|---|
committer | Thomas Müller <DeepDiver1975@users.noreply.github.com> | 2016-05-17 21:40:55 +0200 |
commit | de5b7609f96e166b96b7380e62d32ac51d85d50f (patch) | |
tree | 4abf914475773f70294ad4be8dad6c00871dca37 /lib/public | |
parent | 7dbdf2f7e0192b77761a3f3eb90aa7c39b240e21 (diff) | |
download | nextcloud-server-de5b7609f96e166b96b7380e62d32ac51d85d50f.tar.gz nextcloud-server-de5b7609f96e166b96b7380e62d32ac51d85d50f.zip |
use mount providers to setup home storages (#24567)
Diffstat (limited to 'lib/public')
-rw-r--r-- | lib/public/files/config/ihomemountprovider.php | 43 | ||||
-rw-r--r-- | lib/public/files/config/imountprovidercollection.php | 17 |
2 files changed, 60 insertions, 0 deletions
diff --git a/lib/public/files/config/ihomemountprovider.php b/lib/public/files/config/ihomemountprovider.php new file mode 100644 index 00000000000..bedcd3cfacc --- /dev/null +++ b/lib/public/files/config/ihomemountprovider.php @@ -0,0 +1,43 @@ +<?php +/** + * @author Morris Jobke <hey@morrisjobke.de> + * @author Robin Appelman <icewind@owncloud.com> + * + * @copyright Copyright (c) 2016, ownCloud, Inc. + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see <http://www.gnu.org/licenses/> + * + */ + +namespace OCP\Files\Config; + +use OCP\Files\Storage\IStorageFactory; +use OCP\IUser; + +/** + * Provides + * + * @since 9.1.0 + */ +interface IHomeMountProvider { + /** + * Get all mountpoints applicable for the user + * + * @param \OCP\IUser $user + * @param \OCP\Files\Storage\IStorageFactory $loader + * @return \OCP\Files\Mount\IMountPoint|null + * @since 9.1.0 + */ + public function getHomeMountForUser(IUser $user, IStorageFactory $loader); +} diff --git a/lib/public/files/config/imountprovidercollection.php b/lib/public/files/config/imountprovidercollection.php index 39da61812a9..29208cb6f53 100644 --- a/lib/public/files/config/imountprovidercollection.php +++ b/lib/public/files/config/imountprovidercollection.php @@ -40,6 +40,15 @@ interface IMountProviderCollection { public function getMountsForUser(IUser $user); /** + * Get the configured home mount for this user + * + * @param \OCP\IUser $user + * @return \OCP\Files\Mount\IMountPoint + * @since 9.1.0 + */ + public function getHomeMountForUser(IUser $user); + + /** * Add a provider for mount points * * @param \OCP\Files\Config\IMountProvider $provider @@ -48,6 +57,14 @@ interface IMountProviderCollection { public function registerProvider(IMountProvider $provider); /** + * Add a provider for home mount points + * + * @param \OCP\Files\Config\IHomeMountProvider $provider + * @since 9.1.0 + */ + public function registerHomeProvider(IHomeMountProvider $provider); + + /** * Get the mount cache which can be used to search for mounts without setting up the filesystem * * @return IUserMountCache |