mirror of
https://github.com/nextcloud/server.git
synced 2026-06-11 01:30:50 -04:00
fix: use correct permissions mark for non-home storage public links
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
e01a54c53a
commit
43ee64495d
1 changed files with 11 additions and 5 deletions
|
|
@ -7,6 +7,7 @@
|
|||
*/
|
||||
use OC\Files\Filesystem;
|
||||
use OC\Files\Storage\Wrapper\DirPermissionsMask;
|
||||
use OC\Files\Storage\Wrapper\PermissionsMask;
|
||||
use OC\Files\View;
|
||||
use OCA\DAV\Connector\Sabre\PublicAuth;
|
||||
use OCA\DAV\Connector\Sabre\ServerFactory;
|
||||
|
|
@ -21,6 +22,7 @@ use OCP\App\IAppManager;
|
|||
use OCP\BeforeSabrePubliclyLoadedEvent;
|
||||
use OCP\Constants;
|
||||
use OCP\EventDispatcher\IEventDispatcher;
|
||||
use OCP\Files\IHomeStorage;
|
||||
use OCP\Files\IRootFolder;
|
||||
use OCP\Files\Mount\IMountManager;
|
||||
use OCP\ICacheFactory;
|
||||
|
|
@ -115,11 +117,15 @@ $server = $serverFactory->createServer(true, $baseuri, $requestUri, $authPlugin,
|
|||
$mask |= Constants::PERMISSION_READ | Constants::PERMISSION_DELETE;
|
||||
}
|
||||
|
||||
return new DirPermissionsMask([
|
||||
'storage' => $storage,
|
||||
'mask' => $mask,
|
||||
'path' => 'files',
|
||||
]);
|
||||
if ($storage instanceof IHomeStorage) {
|
||||
return new DirPermissionsMask([
|
||||
'storage' => $storage,
|
||||
'mask' => $mask,
|
||||
'path' => 'files',
|
||||
]);
|
||||
} else {
|
||||
return new PermissionsMask(['storage' => $storage, 'mask' => $mask]);
|
||||
}
|
||||
});
|
||||
|
||||
/** @psalm-suppress MissingClosureParamType */
|
||||
|
|
|
|||
Loading…
Reference in a new issue