summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2015-12-08 13:02:57 +0100
committerVincent Petry <pvince81@owncloud.com>2015-12-08 13:13:26 +0100
commit6e4006d1397817f83c2dd3cafc4d697ac1e6a2a7 (patch)
treebe6fcea04ec245dae3eeba973c04a383897ba490 /apps
parente241d2631672836d7a512cd890b14d7523fbc756 (diff)
downloadnextcloud-server-6e4006d1397817f83c2dd3cafc4d697ac1e6a2a7.tar.gz
nextcloud-server-6e4006d1397817f83c2dd3cafc4d697ac1e6a2a7.zip
Add reshare permission checks
Added in isSharable() in incoming remote share. Added in isSharable() in regular incoming share. Added in FileInfo to make sure the proper attributes are returned to the clients.
Diffstat (limited to 'apps')
-rw-r--r--apps/files_sharing/lib/external/storage.php8
-rw-r--r--apps/files_sharing/lib/sharedstorage.php2
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);