mirror of
https://github.com/nextcloud/server.git
synced 2026-06-10 17:23:59 -04:00
fix: only mask the permissions for the users home directory for public shares
this ensures that versions/trashbin/etc is still usable Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
e96a89e630
commit
3cd3c6dd90
2 changed files with 7 additions and 3 deletions
|
|
@ -6,7 +6,7 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
use OC\Files\Filesystem;
|
||||
use OC\Files\Storage\Wrapper\PermissionsMask;
|
||||
use OC\Files\Storage\Wrapper\DirPermissionsMask;
|
||||
use OC\Files\View;
|
||||
use OCA\DAV\Connector\LegacyPublicAuth;
|
||||
use OCA\DAV\Connector\Sabre\ServerFactory;
|
||||
|
|
@ -98,7 +98,11 @@ $server = $serverFactory->createServer(
|
|||
// FIXME: should not add storage wrappers outside of preSetup, need to find a better way
|
||||
$previousLog = Filesystem::logWarningWhenAddingStorageWrapper(false);
|
||||
Filesystem::addStorageWrapper('sharePermissions', function ($mountPoint, $storage) use ($share) {
|
||||
return new PermissionsMask(['storage' => $storage, 'mask' => $share->getPermissions() | Constants::PERMISSION_SHARE]);
|
||||
return new DirPermissionsMask([
|
||||
'storage' => $storage,
|
||||
'mask' => $share->getPermissions() | Constants::PERMISSION_SHARE,
|
||||
'path' => 'files'
|
||||
]);
|
||||
});
|
||||
Filesystem::addStorageWrapper('shareOwner', function ($mountPoint, $storage) use ($share) {
|
||||
return new PublicOwnerWrapper(['storage' => $storage, 'owner' => $share->getShareOwner()]);
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@ class LegacyVersionsBackend implements IVersionBackend, IDeletableVersionBackend
|
|||
Storage::scheduleExpire($user->getUID(), $relativePath);
|
||||
|
||||
// store a new version of a file
|
||||
$res = $userView->copy('files/' . $relativePath, 'files_versions/' . $relativePath . '.v' . $file->getMtime());
|
||||
$userView->copy('files/' . $relativePath, 'files_versions/' . $relativePath . '.v' . $file->getMtime());
|
||||
// ensure the file is scanned
|
||||
$userView->getFileInfo('files_versions/' . $relativePath . '.v' . $file->getMtime());
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue