Skip to content

Commit f657624

Browse files
committed
fix: use correct permissions mark for non-home storage public links
Signed-off-by: Robin Appelman <robin@icewind.nl>
1 parent d44790d commit f657624

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

apps/dav/appinfo/v2/publicremote.php

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
*/
88
use OC\Files\Filesystem;
99
use OC\Files\Storage\Wrapper\DirPermissionsMask;
10+
use OC\Files\Storage\Wrapper\PermissionsMask;
1011
use OC\Files\View;
1112
use OCA\DAV\Connector\Sabre\PublicAuth;
1213
use OCA\DAV\Connector\Sabre\ServerFactory;
@@ -21,6 +22,7 @@
2122
use OCP\BeforeSabrePubliclyLoadedEvent;
2223
use OCP\Constants;
2324
use OCP\EventDispatcher\IEventDispatcher;
25+
use OCP\Files\IHomeStorage;
2426
use OCP\Files\IRootFolder;
2527
use OCP\Files\Mount\IMountManager;
2628
use OCP\ICacheFactory;
@@ -115,11 +117,15 @@
115117
$mask |= Constants::PERMISSION_READ | Constants::PERMISSION_DELETE;
116118
}
117119

118-
return new DirPermissionsMask([
119-
'storage' => $storage,
120-
'mask' => $mask,
121-
'path' => 'files',
122-
]);
120+
if ($storage instanceof IHomeStorage) {
121+
return new DirPermissionsMask([
122+
'storage' => $storage,
123+
'mask' => $mask,
124+
'path' => 'files',
125+
]);
126+
} else {
127+
return new PermissionsMask(['storage' => $storage, 'mask' => $mask]);
128+
}
123129
});
124130

125131
/** @psalm-suppress MissingClosureParamType */

0 commit comments

Comments
 (0)