diff options
author | Robin Appelman <robin@icewind.nl> | 2018-08-16 20:24:02 +0200 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2018-08-16 21:27:54 +0200 |
commit | 720b27d60b330a4752366327ec2ee42e2899b3ec (patch) | |
tree | 4c3d576d3b24766a34b4cb58f41d16bca0a3eeb9 /apps | |
parent | b5217b6f6376f1a4384b9265d36c6d9348f84c68 (diff) | |
download | nextcloud-server-720b27d60b330a4752366327ec2ee42e2899b3ec.tar.gz nextcloud-server-720b27d60b330a4752366327ec2ee42e2899b3ec.zip |
only determine is sharing is disabled for a user once
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_sharing/lib/MountProvider.php | 4 | ||||
-rw-r--r-- | apps/files_sharing/lib/SharedStorage.php | 10 |
2 files changed, 12 insertions, 2 deletions
diff --git a/apps/files_sharing/lib/MountProvider.php b/apps/files_sharing/lib/MountProvider.php index cc29a8ce686..96af77d54ec 100644 --- a/apps/files_sharing/lib/MountProvider.php +++ b/apps/files_sharing/lib/MountProvider.php @@ -87,6 +87,7 @@ class MountProvider implements IMountProvider { $mounts = []; $view = new View('/' . $user->getUID() . '/files'); $ownerViews = []; + $sharingDisabledForUser = $this->shareManager->sharingDisabledForUser($user->getUID()); foreach ($superShares as $share) { try { /** @var \OCP\Share\IShare $parentShare */ @@ -104,7 +105,8 @@ class MountProvider implements IMountProvider { 'superShare' => $parentShare, // children/component of the superShare 'groupedShares' => $share[1], - 'ownerView' => $ownerViews[$owner] + 'ownerView' => $ownerViews[$owner], + 'sharingDisabledForUser' => $sharingDisabledForUser ], $storageFactory, $view diff --git a/apps/files_sharing/lib/SharedStorage.php b/apps/files_sharing/lib/SharedStorage.php index f681854cd2b..2d2f14fc554 100644 --- a/apps/files_sharing/lib/SharedStorage.php +++ b/apps/files_sharing/lib/SharedStorage.php @@ -79,6 +79,9 @@ class SharedStorage extends \OC\Files\Storage\Wrapper\Jail implements ISharedSto private $options; + /** @var boolean */ + private $sharingDisabledForUser; + public function __construct($arguments) { $this->ownerView = $arguments['ownerView']; $this->logger = \OC::$server->getLogger(); @@ -87,6 +90,11 @@ class SharedStorage extends \OC\Files\Storage\Wrapper\Jail implements ISharedSto $this->groupedShares = $arguments['groupedShares']; $this->user = $arguments['user']; + if (isset($arguments['sharingDisabledForUser'])) { + $this->sharingDisabledForUser = $arguments['sharingDisabledForUser']; + } else { + $this->sharingDisabledForUser = false; + } parent::__construct([ 'storage' => null, @@ -193,7 +201,7 @@ class SharedStorage extends \OC\Files\Storage\Wrapper\Jail implements ISharedSto $permissions |= \OCP\Constants::PERMISSION_DELETE; } - if (\OCP\Util::isSharingDisabledForUser()) { + if ($this->sharingDisabledForUser) { $permissions &= ~\OCP\Constants::PERMISSION_SHARE; } |