Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Refactor shared storage #12086

Closed
wants to merge 21 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
65ddee1
Drop the readonly cache and wrapper in favour of the generic permissi…
icewind1991 Nov 10, 2014
19a8d95
Replace the shared storage with the jail and permissions mask wrappers
icewind1991 Nov 10, 2014
8d72e24
Extract shared mount setup code to its own class
icewind1991 Nov 11, 2014
062bea8
Use the post_initMountPoints hook instead of the setup hook
icewind1991 Nov 12, 2014
e6d6362
Add owner information to the result of the cache
icewind1991 Nov 12, 2014
020b79e
Fix unit test
icewind1991 Nov 12, 2014
637b378
Always format mount points correctly
icewind1991 Nov 12, 2014
efe13c4
Keep track of the relative mountpoint for renaming/unmounting
icewind1991 Nov 12, 2014
8f0816d
Cleanup proxies for tests
icewind1991 Nov 12, 2014
35c772b
Rename all usages of \OC\Files\Storage\Shared
icewind1991 Nov 13, 2014
4ce9e54
dont fail hard when a user doesnt exist
icewind1991 Nov 13, 2014
3125d24
fix getOwner
icewind1991 Dec 1, 2014
f0ff50d
Expose the mount manager as public api
icewind1991 Dec 9, 2014
86504c8
Copy mounts from shared folder to the target folder
icewind1991 Dec 9, 2014
7d325e7
Adjust unit test
icewind1991 Dec 10, 2014
5d24527
Only apply each wrapper one time for each mountpoint
icewind1991 Dec 18, 2014
e3e178c
Dont allow moving movable mounts inside each other
icewind1991 Dec 18, 2014
6f66557
Check that the source exists
icewind1991 Dec 19, 2014
8d74ec0
Fix cachejail with empty root
icewind1991 Dec 19, 2014
1a6f731
rename to mount provider
icewind1991 Dec 19, 2014
c75067d
Wrap the original file when creating the shared storage
icewind1991 Dec 19, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion apps/files_encryption/tests/testcase.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ public static function setUpBeforeClass() {
\OCA\Files_Encryption\Helper::registerShareHooks();

\OC::registerShareHooks();
\OCP\Util::connectHook('OC_Filesystem', 'setup', '\OC\Files\Storage\Shared', 'setup');

// clear and register hooks
\OC_FileProxy::clearProxies();
Expand Down
8 changes: 4 additions & 4 deletions apps/files_external/lib/config/configadapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ class ConfigAdapter implements IMountProvider {
* Get all mountpoints applicable for the user
*
* @param \OCP\IUser $user
* @param \OCP\Files\Storage\IStorageFactory $loader
* @param \OCP\Files\Storage\IStorageFactory $factory
* @return \OCP\Files\Mount\IMountPoint[]
*/
public function getMountsForUser(IUser $user, IStorageFactory $loader) {
public function getMountsForUser(IUser $user, IStorageFactory $factory) {
$mountPoints = \OC_Mount_Config::getAbsoluteMountPoints($user->getUID());
$mounts = array();
foreach ($mountPoints as $mountPoint => $options) {
Expand All @@ -35,9 +35,9 @@ public function getMountsForUser(IUser $user, IStorageFactory $loader) {
}
$mountOptions = isset($options['mountOptions']) ? $options['mountOptions'] : [];
if (isset($options['personal']) && $options['personal']) {
$mounts[] = new PersonalMount($options['class'], $mountPoint, $options['options'], $loader, $mountOptions);
$mounts[] = new PersonalMount($options['class'], $mountPoint, $options['options'], $factory, $mountOptions);
} else {
$mounts[] = new MountPoint($options['class'], $mountPoint, $options['options'], $loader, $mountOptions);
$mounts[] = new MountPoint($options['class'], $mountPoint, $options['options'], $factory, $mountOptions);
}
}
return $mounts;
Expand Down
2 changes: 1 addition & 1 deletion apps/files_sharing/ajax/shareinfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
$isWritable = $linkItem['permissions'] & (\OCP\Constants::PERMISSION_UPDATE | \OCP\Constants::PERMISSION_CREATE);
if (!$isWritable) {
\OC\Files\Filesystem::addStorageWrapper('readonly', function ($mountPoint, $storage) {
return new \OCA\Files_Sharing\ReadOnlyWrapper(array('storage' => $storage));
return new \OC\Files\Storage\Wrapper\PermissionsMask(array('storage' => $storage, \OCP\PERMISSION_READ));
});
}

Expand Down
7 changes: 7 additions & 0 deletions apps/files_sharing/appinfo/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,10 @@
}
}
}

$mountProviderCollection = \OC::$server->getMountProviderCollection();
$mountProvider = new \OCA\Files_Sharing\ShareMountProvider(
\OC::$server->getUserManager(),
\OC::$server->getMountManager()
);
$mountProviderCollection->registerProvider($mountProvider);
Loading