diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-12-09 10:04:56 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-12-09 10:04:56 +0100 |
commit | bc744ff6debe5f812b3c4a32f56b133b3cb3c145 (patch) | |
tree | bfd74101cc806c56bfe2f0c1d5c2ced5b6849328 /apps/files_sharing | |
parent | 6ba22f0243b8d0f33a4c2b7e56bae5b971614d02 (diff) | |
parent | d0cca6c3aded2aaa35e5b2caab46ff49676eecbd (diff) | |
download | nextcloud-server-bc744ff6debe5f812b3c4a32f56b133b3cb3c145.tar.gz nextcloud-server-bc744ff6debe5f812b3c4a32f56b133b3cb3c145.zip |
Merge pull request #21038 from owncloud/share-computesharepermissions-notstore
Fix (re)share permission checks in a few code paths
Diffstat (limited to 'apps/files_sharing')
-rw-r--r-- | apps/files_sharing/lib/external/storage.php | 8 | ||||
-rw-r--r-- | apps/files_sharing/lib/sharedstorage.php | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/apps/files_sharing/lib/external/storage.php b/apps/files_sharing/lib/external/storage.php index 2a0d827e064..36ff4f0c226 100644 --- a/apps/files_sharing/lib/external/storage.php +++ b/apps/files_sharing/lib/external/storage.php @@ -265,4 +265,12 @@ class Storage extends DAV implements ISharedStorage { list(, $remote) = explode('://', $this->remote, 2); return $this->remoteUser . '@' . $remote; } + + public function isSharable($path) { + if (\OCP\Util::isSharingDisabledForUser() || !\OC\Share\Share::isResharingAllowed()) { + return false; + } + return ($this->getPermissions($path) & \OCP\Constants::PERMISSION_SHARE); + } + } diff --git a/apps/files_sharing/lib/sharedstorage.php b/apps/files_sharing/lib/sharedstorage.php index cda3f564d5f..38f79762dc6 100644 --- a/apps/files_sharing/lib/sharedstorage.php +++ b/apps/files_sharing/lib/sharedstorage.php @@ -257,7 +257,7 @@ class Shared extends \OC\Files\Storage\Common implements ISharedStorage { } public function isSharable($path) { - if (\OCP\Util::isSharingDisabledForUser()) { + if (\OCP\Util::isSharingDisabledForUser() || !\OC\Share\Share::isResharingAllowed()) { return false; } return ($this->getPermissions($path) & \OCP\Constants::PERMISSION_SHARE); |