diff options
author | Bjoern Schiessle <schiessle@owncloud.com> | 2014-05-13 15:22:18 +0200 |
---|---|---|
committer | Bjoern Schiessle <schiessle@owncloud.com> | 2014-05-22 10:43:44 +0200 |
commit | 12338e0ef07c409156fa9cd1008bb981bda20461 (patch) | |
tree | fe859814a2321ab98f498a623db39dab892b8153 /apps/files_sharing/lib/sharedstorage.php | |
parent | 14a953fbe01a3d26e1330ea224ab71928a2f93c1 (diff) | |
download | nextcloud-server-12338e0ef07c409156fa9cd1008bb981bda20461.tar.gz nextcloud-server-12338e0ef07c409156fa9cd1008bb981bda20461.zip |
allow admin to disable sharing for specific groups of users
Diffstat (limited to 'apps/files_sharing/lib/sharedstorage.php')
-rw-r--r-- | apps/files_sharing/lib/sharedstorage.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/apps/files_sharing/lib/sharedstorage.php b/apps/files_sharing/lib/sharedstorage.php index c18e30966f0..07a0acf00a5 100644 --- a/apps/files_sharing/lib/sharedstorage.php +++ b/apps/files_sharing/lib/sharedstorage.php @@ -108,6 +108,11 @@ class Shared extends \OC\Files\Storage\Common { if (pathinfo($target, PATHINFO_EXTENSION) === 'part') { $permissions |= \OCP\PERMISSION_DELETE; } + + if (\OC_Util::isSharingDisabledForUser()) { + $permissions &= ~\OCP\PERMISSION_SHARE; + } + return $permissions; } @@ -198,6 +203,9 @@ class Shared extends \OC\Files\Storage\Common { } public function isSharable($path) { + if (\OCP\Util::isSharingDisabledForUser()) { + return false; + } return ($this->getPermissions($path) & \OCP\PERMISSION_SHARE); } |