Skip to content

Commit 6d96ec4

Browse files
committed
block webdav access if share is not readable
1 parent d0efc10 commit 6d96ec4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

apps/dav/appinfo/v1/publicwebdav.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,13 @@
6767
$share = $authBackend->getShare();
6868
$owner = $share->getShareOwner();
6969
$isWritable = $share->getPermissions() & (\OCP\Constants::PERMISSION_UPDATE | \OCP\Constants::PERMISSION_CREATE);
70+
$isReadable = $share->getPermissions() & \OCP\Constants::PERMISSION_READ;
7071
$fileId = $share->getNodeId();
7172

73+
if (!$isReadable) {
74+
return false;
75+
}
76+
7277
if (!$isWritable) {
7378
\OC\Files\Filesystem::addStorageWrapper('readonly', function ($mountPoint, $storage) {
7479
return new \OC\Files\Storage\Wrapper\PermissionsMask(array('storage' => $storage, 'mask' => \OCP\Constants::PERMISSION_READ + \OCP\Constants::PERMISSION_SHARE));

0 commit comments

Comments
 (0)