diff options
author | Julien Veyssier <eneiluj@posteo.net> | 2022-06-21 14:25:36 +0200 |
---|---|---|
committer | Julien Veyssier <eneiluj@posteo.net> | 2022-08-01 15:00:51 +0200 |
commit | e251e0c31435ab2d80f8f39c3380f5634a4c9c6f (patch) | |
tree | cae4ec463d4b2a81a53737897f54b82c9e55fa93 /lib | |
parent | f74e89bde5892a68500eeea3fa98a511b1d7f7e9 (diff) | |
download | nextcloud-server-e251e0c31435ab2d80f8f39c3380f5634a4c9c6f.tar.gz nextcloud-server-e251e0c31435ab2d80f8f39c3380f5634a4c9c6f.zip |
don't reduce file public link permissions if public upload is not enabled
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Share20/Manager.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php index a46126b7ac4..2ef61cf3404 100644 --- a/lib/private/Share20/Manager.php +++ b/lib/private/Share20/Manager.php @@ -650,7 +650,7 @@ class Manager implements IManager { } // Check if public upload is allowed - if (!$this->shareApiLinkAllowPublicUpload() && + if ($share->getNodeType() === 'folder' && !$this->shareApiLinkAllowPublicUpload() && ($share->getPermissions() & (\OCP\Constants::PERMISSION_CREATE | \OCP\Constants::PERMISSION_UPDATE | \OCP\Constants::PERMISSION_DELETE))) { throw new \InvalidArgumentException('Public upload is not allowed'); } @@ -1544,7 +1544,7 @@ class Manager implements IManager { * Reduce the permissions for link or email shares if public upload is not enabled */ if (($share->getShareType() === IShare::TYPE_LINK || $share->getShareType() === IShare::TYPE_EMAIL) - && !$this->shareApiLinkAllowPublicUpload()) { + && $share->getNodeType() === 'folder' && !$this->shareApiLinkAllowPublicUpload()) { $share->setPermissions($share->getPermissions() & ~(\OCP\Constants::PERMISSION_CREATE | \OCP\Constants::PERMISSION_UPDATE)); } |