diff options
author | Robin Appelman <icewind@owncloud.com> | 2015-12-02 16:23:50 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2016-01-29 13:14:26 +0100 |
commit | 3c8aac3867f295992dbe05bdab155bbd3ef4978f (patch) | |
tree | 38867ce7a86f74e2612e906fcac97dd26cef7d56 /lib | |
parent | b65a23ca4b41ee7ce6290eacde44caeb70a00b2e (diff) | |
download | nextcloud-server-3c8aac3867f295992dbe05bdab155bbd3ef4978f.tar.gz nextcloud-server-3c8aac3867f295992dbe05bdab155bbd3ef4978f.zip |
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()) { |