diff options
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()) { |