summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2016-02-02 10:26:24 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2016-02-02 10:26:24 +0100
commit4777f78187cb758413db1b11f11ccb9304f12482 (patch)
treedb14ca528a9617e356b97e724c273518a51a0dc3 /lib
parente60b217156aa0f2e037a3f9e23c8314e05cfbbd1 (diff)
parent279a54bc8790986bfc0d206c622f9c7c969a2da3 (diff)
downloadnextcloud-server-4777f78187cb758413db1b11f11ccb9304f12482.tar.gz
nextcloud-server-4777f78187cb758413db1b11f11ccb9304f12482.zip
Merge pull request #20903 from owncloud/sharing-mount-option
Add mount option to disable sharing
Diffstat (limited to 'lib')
-rw-r--r--lib/private/util.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/private/util.php b/lib/private/util.php
index 64695d95a03..28541eff773 100644
--- a/lib/private/util.php
+++ b/lib/private/util.php
@@ -152,6 +152,16 @@ class OC_Util {
return $storage;
});
+ \OC\Files\Filesystem::addStorageWrapper('enable_sharing', function ($mountPoint, \OCP\Files\Storage $storage, \OCP\Files\Mount\IMountPoint $mount) {
+ if (!$mount->getOption('enable_sharing', true)) {
+ return new \OC\Files\Storage\Wrapper\PermissionsMask([
+ 'storage' => $storage,
+ 'mask' => \OCP\Constants::PERMISSION_ALL - \OCP\Constants::PERMISSION_SHARE
+ ]);
+ }
+ return $storage;
+ });
+
// install storage availability wrapper, before most other wrappers
\OC\Files\Filesystem::addStorageWrapper('oc_availability', function ($mountPoint, $storage) {
if (!$storage->isLocal()) {