diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2016-02-02 10:26:24 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-02-02 10:26:24 +0100 |
commit | 4777f78187cb758413db1b11f11ccb9304f12482 (patch) | |
tree | db14ca528a9617e356b97e724c273518a51a0dc3 /lib | |
parent | e60b217156aa0f2e037a3f9e23c8314e05cfbbd1 (diff) | |
parent | 279a54bc8790986bfc0d206c622f9c7c969a2da3 (diff) | |
download | nextcloud-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.php | 10 |
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()) { |